summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Hill <hillad@gmail.com>2013-03-13 08:10:48 -0500
committerAndy Hill <hillad@gmail.com>2013-03-13 10:56:33 -0500
commitd4509dd2ad1e740250f46bb281de3b6bcf39de85 (patch)
tree44f2fba4e88ea9486f16ae2b3138db6e828887c1
parentc12f4bc0e37973e26c2109c7f85f505b776b5574 (diff)
downloadpython-novaclient-d4509dd2ad1e740250f46bb281de3b6bcf39de85.tar.gz
Removes tenant IDs checking for nova quota operations.
Until there is a way to validate tenant IDs, remove the existing checks. Fixes bug #1154582 Change-Id: If10fac17b919190c1492cfbf1be9950284a82197
-rw-r--r--novaclient/v1_1/shell.py9
-rw-r--r--tests/v1_1/test_shell.py12
2 files changed, 3 insertions, 18 deletions
diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py
index e0392c56..56bbc3cd 100644
--- a/novaclient/v1_1/shell.py
+++ b/novaclient/v1_1/shell.py
@@ -2701,7 +2701,6 @@ def _quota_show(quotas):
def _quota_update(manager, identifier, args):
updates = {}
- utils.check_uuid_like(identifier)
for resource in _quota_resources:
val = getattr(args, resource, None)
if val is not None:
@@ -2714,34 +2713,32 @@ def _quota_update(manager, identifier, args):
@utils.arg('--tenant',
metavar='<tenant-id>',
default=None,
- help='UUID of tenant to list the quotas for.')
+ help='ID of tenant to list the quotas for.')
def do_quota_show(cs, args):
"""List the quotas for a tenant."""
if not args.tenant:
_quota_show(cs.quotas.get(cs.client.tenant_id))
else:
- utils.check_uuid_like(args.tenant)
_quota_show(cs.quotas.get(args.tenant))
@utils.arg('--tenant',
metavar='<tenant-id>',
default=None,
- help='UUID of tenant to list the default quotas for.')
+ help='ID of tenant to list the default quotas for.')
def do_quota_defaults(cs, args):
"""List the default quotas for a tenant."""
if not args.tenant:
_quota_show(cs.quotas.defaults(cs.client.tenant_id))
else:
- utils.check_uuid_like(args.tenant)
_quota_show(cs.quotas.defaults(args.tenant))
@utils.arg('tenant',
metavar='<tenant-id>',
- help='UUID of tenant to set the quotas for.')
+ help='ID of tenant to set the quotas for.')
@utils.arg('--instances',
metavar='<instances>',
type=int, default=None,
diff --git a/tests/v1_1/test_shell.py b/tests/v1_1/test_shell.py
index 8cc5c19f..b7901c4c 100644
--- a/tests/v1_1/test_shell.py
+++ b/tests/v1_1/test_shell.py
@@ -991,9 +991,6 @@ class ShellTest(utils.TestCase):
'97f4c221bff44578b0300df4ef119353')
self.assert_called('GET',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353')
- self.assertRaises(exceptions.CommandError,
- self.run_command,
- 'quota-show --tenant not_uuid')
def test_quota_show_no_tenant(self):
self.run_command('quota-show')
@@ -1004,9 +1001,6 @@ class ShellTest(utils.TestCase):
'97f4c221bff44578b0300df4ef119353')
self.assert_called('GET',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353/defaults')
- self.assertRaises(exceptions.CommandError,
- self.run_command,
- 'quota-defaults --tenant not_uuid')
def test_quota_defaults_no_nenant(self):
self.run_command('quota-defaults')
@@ -1019,12 +1013,6 @@ class ShellTest(utils.TestCase):
self.assert_called('PUT',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353')
- def test_quota_update_error(self):
- self.assertRaises(exceptions.CommandError,
- self.run_command,
- 'quota-update 7f4c221-bff4-4578-b030-0df4ef119353'
- ' --instances=5')
-
def test_quota_class_show(self):
self.run_command('quota-class-show test')
self.assert_called('GET', '/os-quota-class-sets/test')