diff options
| author | qinchunhua <qin.chunhua@zte.com.cn> | 2016-07-07 07:42:01 -0400 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2016-07-07 15:05:58 +0000 |
| commit | 6f36385cb87d04577d60032f6e74c732edab6d45 (patch) | |
| tree | 86e2d4b3dbe578529fc6884aea0761146a78493f /openstackclient/identity/v3/role.py | |
| parent | 272d19340117927f6988c61113abc3dd995af76d (diff) | |
| download | python-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/v3/role.py')
| -rwxr-xr-x[-rw-r--r--] | openstackclient/identity/v3/role.py | 4 |
1 files changed, 2 insertions, 2 deletions
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))) |
