Merge "Remove invalid parameter of quota-update"
This commit is contained in:
commit
7cf73f1942
novaclient
@ -1038,8 +1038,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,
|
||||
@ -1055,8 +1053,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,
|
||||
@ -1072,8 +1068,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,
|
||||
@ -1089,8 +1083,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,
|
||||
@ -1106,8 +1098,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,
|
||||
@ -1123,8 +1113,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,
|
||||
@ -1140,8 +1128,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,
|
||||
@ -1160,8 +1146,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,
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -3085,7 +3085,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',
|
||||
@ -3177,14 +3177,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,
|
||||
@ -3292,14 +3284,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,
|
||||
|
@ -2638,7 +2638,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']
|
||||
|
||||
|
||||
@ -2738,14 +2738,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,
|
||||
@ -2809,14 +2801,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user