summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v2_0/project.py
diff options
context:
space:
mode:
authorqinchunhua <qin.chunhua@zte.com.cn>2016-07-07 07:42:01 -0400
committerSteve Martinelli <s.martinelli@gmail.com>2016-07-07 15:05:58 +0000
commit6f36385cb87d04577d60032f6e74c732edab6d45 (patch)
tree86e2d4b3dbe578529fc6884aea0761146a78493f /openstackclient/identity/v2_0/project.py
parent272d19340117927f6988c61113abc3dd995af76d (diff)
downloadpython-openstackclient-6f36385cb87d04577d60032f6e74c732edab6d45.tar.gz
Correct reraising of exception
When an exception was caught and rethrown, it should call 'raise' without any arguments because it shows the place where an exception occured initially instead of place where the exception re-raised. Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
Diffstat (limited to 'openstackclient/identity/v2_0/project.py')
-rwxr-xr-x[-rw-r--r--]openstackclient/identity/v2_0/project.py8
1 files changed, 4 insertions, 4 deletions
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)