Remove invalid parameter of quota-update

nova quota-update doesn't support update '--gigabytes' and '--volumes', but
CLI  include these two parameter, so it should remove these two parameter
from novaclient

Change-Id: I9db39dd397ba3368f214377f37b56ac4f4f3864c
Closes-bug: #1277673
This commit is contained in:
shihanzhang 2014-02-11 14:50:54 +08:00
parent 7c3c1bb0dd
commit ff815fb4d0
5 changed files with 2 additions and 75 deletions

View File

@ -1036,8 +1036,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1053,8 +1051,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1070,8 +1066,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1087,8 +1081,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1104,8 +1096,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1121,8 +1111,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1138,8 +1126,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 1,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,
@ -1158,8 +1144,6 @@ class FakeHTTPClient(base_client.HTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 2,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,

View File

@ -42,20 +42,6 @@ class QuotaSetsTest(utils.TestCase):
self.cs.quotas.defaults(tenant_id)
self.cs.assert_called('GET', '/os-quota-sets/%s/defaults' % tenant_id)
def test_update_quota(self):
q = self.cs.quotas.get('97f4c221bff44578b0300df4ef119353')
q.update(volumes=2)
self.cs.assert_called('PUT',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353')
def test_update_user_quota(self):
tenant_id = '97f4c221bff44578b0300df4ef119353'
user_id = 'fake_user'
q = self.cs.quotas.get(tenant_id)
q.update(volumes=2, user_id=user_id)
url = '/os-quota-sets/%s?user_id=%s' % (tenant_id, user_id)
self.cs.assert_called('PUT', url)
def test_force_update_quota(self):
q = self.cs.quotas.get('97f4c221bff44578b0300df4ef119353')
q.update(cores=2, force=True)
@ -65,15 +51,6 @@ class QuotaSetsTest(utils.TestCase):
'cores': 2,
'tenant_id': '97f4c221bff44578b0300df4ef119353'}})
def test_refresh_quota(self):
q = self.cs.quotas.get('test')
q2 = self.cs.quotas.get('test')
self.assertEqual(q.volumes, q2.volumes)
q2.volumes = 0
self.assertNotEqual(q.volumes, q2.volumes)
q2.get()
self.assertEqual(q.volumes, q2.volumes)
def test_quotas_delete(self):
tenant_id = 'test'
self.cs.quotas.delete(tenant_id)

View File

@ -300,8 +300,6 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
'metadata_items': [],
'injected_file_content_bytes': 1,
'injected_file_path_bytes': 1,
'volumes': 2,
'gigabytes': 1,
'ram': 1,
'floating_ips': 1,
'instances': 1,

View File

@ -3065,7 +3065,7 @@ def do_ssh(cs, args):
return
_quota_resources = ['instances', 'cores', 'ram', 'volumes', 'gigabytes',
_quota_resources = ['instances', 'cores', 'ram',
'floating_ips', 'fixed_ips', 'metadata_items',
'injected_files', 'injected_file_content_bytes',
'injected_file_path_bytes', 'key_pairs',
@ -3157,14 +3157,6 @@ def do_quota_defaults(cs, args):
metavar='<ram>',
type=int, default=None,
help='New value for the "ram" quota.')
@utils.arg('--volumes',
metavar='<volumes>',
type=int, default=None,
help='New value for the "volumes" quota.')
@utils.arg('--gigabytes',
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.arg('--floating-ips',
metavar='<floating-ips>',
type=int,
@ -3272,14 +3264,6 @@ def do_quota_class_show(cs, args):
metavar='<ram>',
type=int, default=None,
help='New value for the "ram" quota.')
@utils.arg('--volumes',
metavar='<volumes>',
type=int, default=None,
help='New value for the "volumes" quota.')
@utils.arg('--gigabytes',
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.arg('--floating-ips',
metavar='<floating-ips>',
type=int,

View File

@ -2618,7 +2618,7 @@ def do_ssh(cs, args):
return
_quota_resources = ['instances', 'cores', 'ram', 'volumes', 'gigabytes',
_quota_resources = ['instances', 'cores', 'ram',
'fixed_ips', 'metadata_items', 'key_pairs']
@ -2718,14 +2718,6 @@ def do_quota_defaults(cs, args):
metavar='<ram>',
type=int, default=None,
help='New value for the "ram" quota.')
@utils.arg('--volumes',
metavar='<volumes>',
type=int, default=None,
help='New value for the "volumes" quota.')
@utils.arg('--gigabytes',
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.arg('--fixed-ips',
metavar='<fixed-ips>',
type=int,
@ -2789,14 +2781,6 @@ def do_quota_class_show(cs, args):
metavar='<ram>',
type=int, default=None,
help='New value for the "ram" quota.')
@utils.arg('--volumes',
metavar='<volumes>',
type=int, default=None,
help='New value for the "volumes" quota.')
@utils.arg('--gigabytes',
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.arg('--metadata-items',
metavar='<metadata-items>',
type=int,