CLI implementation should raise CommandError
NeutronClientException is an exception raised from API bindings and it should not be used in CLI layer. TrivialFix Change-Id: I3df4c7352c96f10388df65bd16016b3ceb221248
This commit is contained in:
parent
41961a25fd
commit
d6d42af64a
@ -207,7 +207,7 @@ class UpdateQuota(neutronV20.NeutronCommand, show.ShowOne):
|
|||||||
except Exception:
|
except Exception:
|
||||||
message = (_('Quota limit for %(name)s must be an integer') %
|
message = (_('Quota limit for %(name)s must be an integer') %
|
||||||
{'name': name})
|
{'name': name})
|
||||||
raise exceptions.NeutronClientException(message=message)
|
raise exceptions.CommandError(message=message)
|
||||||
return return_value
|
return return_value
|
||||||
|
|
||||||
def args2body(self, parsed_args):
|
def args2body(self, parsed_args):
|
||||||
|
@ -37,7 +37,7 @@ class CLITestV20Quota(test_cli20.CLITestV20Base):
|
|||||||
test_cli20.MyApp(sys.stdout), None)
|
test_cli20.MyApp(sys.stdout), None)
|
||||||
args = ['--tenant-id', self.test_id, '--network', 'test']
|
args = ['--tenant-id', self.test_id, '--network', 'test']
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.NeutronClientException, self._test_update_resource,
|
exceptions.CommandError, self._test_update_resource,
|
||||||
resource, cmd, self.test_id, args=args,
|
resource, cmd, self.test_id, args=args,
|
||||||
extrafields={'network': 'new'})
|
extrafields={'network': 'new'})
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class CLITestV20Quota(test_cli20.CLITestV20Base):
|
|||||||
test_cli20.MyApp(sys.stdout), None)
|
test_cli20.MyApp(sys.stdout), None)
|
||||||
args = [self.test_id, '--network', 'test']
|
args = [self.test_id, '--network', 'test']
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exceptions.NeutronClientException, self._test_update_resource,
|
exceptions.CommandError, self._test_update_resource,
|
||||||
resource, cmd, self.test_id, args=args,
|
resource, cmd, self.test_id, args=args,
|
||||||
extrafields={'network': 'new'})
|
extrafields={'network': 'new'})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user