summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-07 20:56:17 +0000
committerGerrit Code Review <review@openstack.org>2016-07-07 20:56:18 +0000
commitffb232a90e8b5c8358e017bf057a045a2d59bbfc (patch)
tree4900840df82bb3151d997aee85610df0ecc4ac4a
parent2adeac2bc2421a96273dfbc2b39a43cc06e542e6 (diff)
parent6f36385cb87d04577d60032f6e74c732edab6d45 (diff)
downloadpython-openstackclient-ffb232a90e8b5c8358e017bf057a045a2d59bbfc.tar.gz
Merge "Correct reraising of exception"
-rwxr-xr-x[-rw-r--r--]openstackclient/common/availability_zone.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/common/quota.py2
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v2_0/project.py8
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v2_0/role.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v2_0/user.py8
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v3/domain.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v3/group.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v3/project.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v3/role.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v3/user.py4
-rwxr-xr-x[-rw-r--r--]openstackclient/image/v2/image.py8
-rwxr-xr-x[-rw-r--r--]openstackclient/shell.py4
12 files changed, 29 insertions, 29 deletions
diff --git a/openstackclient/common/availability_zone.py b/openstackclient/common/availability_zone.py
index 89d77d15..63c55370 100644..100755
--- a/openstackclient/common/availability_zone.py
+++ b/openstackclient/common/availability_zone.py
@@ -122,11 +122,11 @@ class ListAvailabilityZone(command.Lister):
compute_client = self.app.client_manager.compute
try:
data = compute_client.availability_zones.list()
- except nova_exceptions.Forbidden as e: # policy doesn't allow
+ except nova_exceptions.Forbidden: # policy doesn't allow
try:
data = compute_client.availability_zones.list(detailed=False)
except Exception:
- raise e
+ raise
# Argh, the availability zones are not iterable...
result = []
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index 69415f0d..3c12c366 100644..100755
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -231,7 +231,7 @@ class ShowQuota(command.ShowOne):
if type(e).__name__ == 'EndpointNotFound':
return {}
else:
- raise e
+ raise
return quota._info
def get_network_quota(self, parsed_args):
diff --git a/openstackclient/identity/v2_0/project.py b/openstackclient/identity/v2_0/project.py
index 6c5db13c..fc5c9201 100644..100755
--- a/openstackclient/identity/v2_0/project.py
+++ b/openstackclient/identity/v2_0/project.py
@@ -86,7 +86,7 @@ class CreateProject(command.ShowOne):
enabled=enabled,
**kwargs
)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
project = utils.find_resource(
identity_client.tenants,
@@ -94,7 +94,7 @@ class CreateProject(command.ShowOne):
)
LOG.info(_('Returning existing project %s'), project.name)
else:
- raise e
+ raise
# TODO(stevemar): Remove the line below when we support multitenancy
project._info.pop('parent_id', None)
@@ -242,7 +242,7 @@ class ShowProject(command.ShowOne):
parsed_args.project,
)
info.update(project._info)
- except ks_exc.Forbidden as e:
+ except ks_exc.Forbidden:
auth_ref = self.app.client_manager.auth_ref
if (
parsed_args.project == auth_ref.project_id or
@@ -256,7 +256,7 @@ class ShowProject(command.ShowOne):
'enabled': True,
}
else:
- raise e
+ raise
# TODO(stevemar): Remove the line below when we support multitenancy
info.pop('parent_id', None)
diff --git a/openstackclient/identity/v2_0/role.py b/openstackclient/identity/v2_0/role.py
index 6d06230c..191cdaa3 100644..100755
--- a/openstackclient/identity/v2_0/role.py
+++ b/openstackclient/identity/v2_0/role.py
@@ -93,7 +93,7 @@ class CreateRole(command.ShowOne):
identity_client = self.app.client_manager.identity
try:
role = identity_client.roles.create(parsed_args.role_name)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
role = utils.find_resource(
identity_client.roles,
@@ -101,7 +101,7 @@ class CreateRole(command.ShowOne):
)
LOG.info(_('Returning existing role %s'), role.name)
else:
- raise e
+ raise
info = {}
info.update(role._info)
diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py
index 0f327830..d2075150 100644..100755
--- a/openstackclient/identity/v2_0/user.py
+++ b/openstackclient/identity/v2_0/user.py
@@ -102,7 +102,7 @@ class CreateUser(command.ShowOne):
tenant_id=project_id,
enabled=enabled,
)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
user = utils.find_resource(
identity_client.users,
@@ -110,7 +110,7 @@ class CreateUser(command.ShowOne):
)
LOG.info(_('Returning existing user %s'), user.name)
else:
- raise e
+ raise
# NOTE(dtroyer): The users.create() method wants 'tenant_id' but
# the returned resource has 'tenantId'. Sigh.
@@ -349,7 +349,7 @@ class ShowUser(command.ShowOne):
parsed_args.user,
)
info.update(user._info)
- except ks_exc.Forbidden as e:
+ except ks_exc.Forbidden:
auth_ref = self.app.client_manager.auth_ref
if (
parsed_args.user == auth_ref.user_id or
@@ -364,7 +364,7 @@ class ShowUser(command.ShowOne):
'enabled': True,
}
else:
- raise e
+ raise
if 'tenantId' in info:
info.update(
diff --git a/openstackclient/identity/v3/domain.py b/openstackclient/identity/v3/domain.py
index 8ba76c41..0546ac52 100644..100755
--- a/openstackclient/identity/v3/domain.py
+++ b/openstackclient/identity/v3/domain.py
@@ -76,13 +76,13 @@ class CreateDomain(command.ShowOne):
description=parsed_args.description,
enabled=enabled,
)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
domain = utils.find_resource(identity_client.domains,
parsed_args.name)
LOG.info(_('Returning existing domain %s'), domain.name)
else:
- raise e
+ raise
domain._info.pop('links')
return zip(*sorted(six.iteritems(domain._info)))
diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py
index 8351fe64..c79a64e7 100644..100755
--- a/openstackclient/identity/v3/group.py
+++ b/openstackclient/identity/v3/group.py
@@ -160,14 +160,14 @@ class CreateGroup(command.ShowOne):
name=parsed_args.name,
domain=domain,
description=parsed_args.description)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
group = utils.find_resource(identity_client.groups,
parsed_args.name,
domain_id=domain)
LOG.info(_('Returning existing group %s'), group.name)
else:
- raise e
+ raise
group._info.pop('links')
return zip(*sorted(six.iteritems(group._info)))
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index 56c1d41a..53987017 100644..100755
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -111,14 +111,14 @@ class CreateProject(command.ShowOne):
enabled=enabled,
**kwargs
)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
project = utils.find_resource(identity_client.projects,
parsed_args.name,
domain_id=domain)
LOG.info(_('Returning existing project %s'), project.name)
else:
- raise e
+ raise
project._info.pop('links')
return zip(*sorted(six.iteritems(project._info)))
diff --git a/openstackclient/identity/v3/role.py b/openstackclient/identity/v3/role.py
index 965ca3f5..d3c530a5 100644..100755
--- a/openstackclient/identity/v3/role.py
+++ b/openstackclient/identity/v3/role.py
@@ -165,13 +165,13 @@ class CreateRole(command.ShowOne):
try:
role = identity_client.roles.create(name=parsed_args.name)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
role = utils.find_resource(identity_client.roles,
parsed_args.name)
LOG.info(_('Returning existing role %s'), role.name)
else:
- raise e
+ raise
role._info.pop('links')
return zip(*sorted(six.iteritems(role._info)))
diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py
index dd5af06a..3e189ac1 100644..100755
--- a/openstackclient/identity/v3/user.py
+++ b/openstackclient/identity/v3/user.py
@@ -121,14 +121,14 @@ class CreateUser(command.ShowOne):
description=parsed_args.description,
enabled=enabled
)
- except ks_exc.Conflict as e:
+ except ks_exc.Conflict:
if parsed_args.or_show:
user = utils.find_resource(identity_client.users,
parsed_args.name,
domain_id=domain_id)
LOG.info(_('Returning existing user %s'), user.name)
else:
- raise e
+ raise
user._info.pop('links')
return zip(*sorted(six.iteritems(user._info)))
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 309b1b6b..64092fea 100644..100755
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -339,7 +339,7 @@ class CreateImage(command.ShowOne):
with fp:
try:
image_client.images.upload(image.id, fp)
- except Exception as e:
+ except Exception:
# If the upload fails for some reason attempt to remove the
# dangling queued image made by the create() call above but
# only if the user did not specify an id which indicates
@@ -349,7 +349,7 @@ class CreateImage(command.ShowOne):
image_client.images.delete(image.id)
except Exception:
pass # we don't care about this one
- raise e # now, throw the upload exception again
+ raise # now, throw the upload exception again
# update the image after the data has been uploaded
image = image_client.images.get(image.id)
@@ -834,11 +834,11 @@ class SetImage(command.Command):
try:
image = image_client.images.update(image.id, **kwargs)
- except Exception as e:
+ except Exception:
if activation_status is not None:
LOG.info(_("Image %(id)s was %(status)s."),
{'id': image.id, 'status': activation_status})
- raise e
+ raise
class ShowImage(command.ShowOne):
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 49a06040..ed729e53 100644..100755
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -331,10 +331,10 @@ class OpenStackShell(app.App):
'auth_type': auth_type,
},
)
- except (IOError, OSError) as e:
+ except (IOError, OSError):
self.log.critical("Could not read clouds.yaml configuration file")
self.print_help_if_requested()
- raise e
+ raise
# TODO(thowe): Change cliff so the default value for debug
# can be set to None.