summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-05-14 08:28:48 -0700
committerMonty Taylor <mordred@inaugust.com>2013-05-14 08:28:48 -0700
commit016a0b301e0ecfea5d84b09e7f1e22a86953c1c1 (patch)
tree8e97f2e2c69a1e4ec2f63ee4a417abaec7337f82 /openstackclient
parentd6c760263b5a7f77bbb35e31f92dd5a9140278ee (diff)
downloadpython-openstackclient-016a0b301e0ecfea5d84b09e7f1e22a86953c1c1.tar.gz
Fix flake8 errors in anticipation of flake8 patch.
Change-Id: Ifdc4322b699f2bd91a6900e55695acd3d736568e
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/common/command.py4
-rw-r--r--openstackclient/common/utils.py2
-rw-r--r--openstackclient/compute/v2/server.py2
-rw-r--r--openstackclient/identity/v2_0/service.py6
-rw-r--r--openstackclient/identity/v2_0/tenant.py3
-rw-r--r--openstackclient/identity/v2_0/user.py3
-rw-r--r--openstackclient/identity/v3/group.py3
-rw-r--r--openstackclient/identity/v3/project.py3
-rw-r--r--openstackclient/identity/v3/user.py3
-rw-r--r--openstackclient/shell.py14
-rw-r--r--openstackclient/volume/v1/quota.py3
11 files changed, 27 insertions, 19 deletions
diff --git a/openstackclient/common/command.py b/openstackclient/common/command.py
index 64e855df..59cd0da2 100644
--- a/openstackclient/common/command.py
+++ b/openstackclient/common/command.py
@@ -15,10 +15,10 @@
"""OpenStack base command"""
-from cliff.command import Command
+from cliff import command
-class OpenStackCommand(Command):
+class OpenStackCommand(command.Command):
"""Base class for OpenStack commands."""
api = None
diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py
index 8a792675..56f9cd17 100644
--- a/openstackclient/common/utils.py
+++ b/openstackclient/common/utils.py
@@ -55,7 +55,7 @@ def find_resource(manager, name_or_id):
except Exception as ex:
try:
return manager.find(display_name=name_or_id)
- except:
+ except Exception:
pass
if type(ex).__name__ == 'NotFound':
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 79deaca4..a2496fad 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -528,7 +528,7 @@ class RebuildServer(show.ShowOne):
_password = None
if parsed_args.rebuild_password is not False:
- _password = args.rebuild_password
+ _password = parsed_args.rebuild_password
kwargs = {}
server = server.rebuild(image, _password, **kwargs)
diff --git a/openstackclient/identity/v2_0/service.py b/openstackclient/identity/v2_0/service.py
index 21e32a51..51abfc18 100644
--- a/openstackclient/identity/v2_0/service.py
+++ b/openstackclient/identity/v2_0/service.py
@@ -141,8 +141,10 @@ class ShowService(show.ShowOne):
# FIXME(dtroyer): This exception should eventually come from
# common client exceptions
except identity_exc.NotFound:
- msg = "No service with a type, name or ID of '%s' exists." % \
- name_or_id
+ msg = "No service with exists."
+ # TODO(mordred): Where does name_or_id come from?
+ # msg = ("No service with a type, name or ID of '%s' exists." %
+ # name_or_id)
raise exceptions.CommandError(msg)
info = {}
diff --git a/openstackclient/identity/v2_0/tenant.py b/openstackclient/identity/v2_0/tenant.py
index 8a2f738f..00a6a977 100644
--- a/openstackclient/identity/v2_0/tenant.py
+++ b/openstackclient/identity/v2_0/tenant.py
@@ -16,6 +16,7 @@
"""Tenant action implementations"""
import logging
+import sys
from cliff import command
from cliff import lister
@@ -167,7 +168,7 @@ class SetTenant(command.Command):
kwargs['enabled'] = parsed_args.enabled
if kwargs == {}:
- stdout.write("Tenant not updated, no arguments present")
+ sys.stdout.write("Tenant not updated, no arguments present")
return 0
tenant.update(**kwargs)
return
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py
index 840cc500..03da6008 100644
--- a/openstackclient/identity/v2_0/user.py
+++ b/openstackclient/identity/v2_0/user.py
@@ -16,6 +16,7 @@
"""Identity v2.0 User action implementations"""
import logging
+import sys
from cliff import command
from cliff import lister
@@ -196,7 +197,7 @@ class SetUser(command.Command):
kwargs['enabled'] = parsed_args.enabled
if not len(kwargs):
- stdout.write("User not updated, no arguments present")
+ sys.stdout.write("User not updated, no arguments present")
return
identity_client.users.update(user.id, **kwargs)
return
diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py
index 3a9b80ed..0562b766 100644
--- a/openstackclient/identity/v3/group.py
+++ b/openstackclient/identity/v3/group.py
@@ -16,6 +16,7 @@
"""Group action implementations"""
import logging
+import sys
from cliff import command
from cliff import lister
@@ -157,7 +158,7 @@ class SetGroup(command.Command):
kwargs['domain'] = domain
if not len(kwargs):
- stdout.write("Group not updated, no arguments present")
+ sys.stdout.write("Group not updated, no arguments present")
return
identity_client.groups.update(group.id, **kwargs)
return
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index d1e67acc..84271cd9 100644
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -16,6 +16,7 @@
"""Project action implementations"""
import logging
+import sys
from cliff import command
from cliff import lister
@@ -189,7 +190,7 @@ class SetProject(command.Command):
kwargs['enabled'] = parsed_args.enabled
if kwargs == {}:
- stdout.write("Project not updated, no arguments present")
+ sys.stdout.write("Project not updated, no arguments present")
return
project.update(**kwargs)
return
diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index bf592d81..7bd37065 100644
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -16,6 +16,7 @@
"""Identity v3 User action implementations"""
import logging
+import sys
from cliff import command
from cliff import lister
@@ -215,7 +216,7 @@ class SetUser(command.Command):
kwargs['enabled'] = parsed_args.enabled
if not len(kwargs):
- stdout.write("User not updated, no arguments present")
+ sys.stdout.write("User not updated, no arguments present")
return
identity_client.users.update(user.id, **kwargs)
return
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 303771c6..cd5ab552 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -20,14 +20,14 @@ import logging
import os
import sys
-from cliff.app import App
-from cliff.help import HelpAction
+from cliff import app
+from cliff import help
from openstackclient.common import clientmanager
+from openstackclient.common.commandmanager import CommandManager
from openstackclient.common import exceptions as exc
from openstackclient.common import openstackkeyring
from openstackclient.common import utils
-from openstackclient.common.commandmanager import CommandManager
VERSION = '0.1'
@@ -53,7 +53,7 @@ def env(*vars, **kwargs):
return kwargs.get('default', '')
-class OpenStackShell(App):
+class OpenStackShell(app.App):
CONSOLE_MESSAGE_FORMAT = '%(levelname)s: %(name)s %(message)s'
@@ -75,10 +75,10 @@ class OpenStackShell(App):
# have been loaded. There doesn't seem to be a
# way to edit/remove anything from an existing parser.
- # Replace the cliff-added HelpAction to defer its execution
+ # Replace the cliff-added help.HelpAction to defer its execution
self.DeferredHelpAction = None
for a in self.parser._actions:
- if type(a) == HelpAction:
+ if type(a) == help.HelpAction:
# Found it, save and replace it
self.DeferredHelpAction = a
@@ -359,7 +359,7 @@ class OpenStackShell(App):
def main(argv=sys.argv[1:]):
try:
return OpenStackShell().run(argv)
- except:
+ except Exception:
return 1
diff --git a/openstackclient/volume/v1/quota.py b/openstackclient/volume/v1/quota.py
index ae6c50f5..4f4e97e8 100644
--- a/openstackclient/volume/v1/quota.py
+++ b/openstackclient/volume/v1/quota.py
@@ -16,6 +16,7 @@
"""Volume v1 Quota action implementations"""
import logging
+import sys
from cliff import command
from cliff import show
@@ -79,7 +80,7 @@ class SetQuota(command.Command):
kwargs['gigabytes'] = parsed_args.gigabytes
if kwargs == {}:
- stdout.write("Quota not updated, no arguments present")
+ sys.stdout.write("Quota not updated, no arguments present")
return
volume_client = self.app.client_manager.volume