From 6f36385cb87d04577d60032f6e74c732edab6d45 Mon Sep 17 00:00:00 2001 From: qinchunhua Date: Thu, 7 Jul 2016 07:42:01 -0400 Subject: 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 --- openstackclient/common/availability_zone.py | 4 ++-- openstackclient/common/quota.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 openstackclient/common/availability_zone.py mode change 100644 => 100755 openstackclient/common/quota.py (limited to 'openstackclient/common') diff --git a/openstackclient/common/availability_zone.py b/openstackclient/common/availability_zone.py old mode 100644 new mode 100755 index 89d77d15..63c55370 --- 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 old mode 100644 new mode 100755 index 69415f0d..3c12c366 --- 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): -- cgit v1.2.1