Permalink
Browse files

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
  • Loading branch information...
1 parent c12f4bc commit d4509dd2ad1e740250f46bb281de3b6bcf39de85 @andyhky andyhky committed Mar 13, 2013
Showing with 3 additions and 18 deletions.
  1. +3 −6 novaclient/v1_1/shell.py
  2. +0 −12 tests/v1_1/test_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,
@@ -991,9 +991,6 @@ def test_quota_show(self):
'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 @@ def test_quota_defaults(self):
'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 @@ def test_quota_update(self):
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')

0 comments on commit d4509dd

Please sign in to comment.