Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for the new fixed_ip quota.

Required for bug 1125468.

Change-Id: If9f8f31a9fd35497a308ae13351685e470e20cd0
  • Loading branch information...
commit 59f8360d7e087ae99a9dcac84c6c81542aa1c94a 1 parent 7850fcd
Michael Still mikalstill authored
3  novaclient/v1_1/quotas.py
View
@@ -39,7 +39,7 @@ def get(self, tenant_id):
def update(self, tenant_id, metadata_items=None,
injected_file_content_bytes=None, injected_file_path_bytes=None,
volumes=None, gigabytes=None,
- ram=None, floating_ips=None, instances=None,
+ ram=None, floating_ips=None, fixed_ips=None, instances=None,
injected_files=None, cores=None, key_pairs=None,
security_groups=None, security_group_rules=None):
@@ -53,6 +53,7 @@ def update(self, tenant_id, metadata_items=None,
'gigabytes': gigabytes,
'ram': ram,
'floating_ips': floating_ips,
+ 'fixed_ips': fixed_ips,
'instances': instances,
'injected_files': injected_files,
'cores': cores,
13 novaclient/v1_1/shell.py
View
@@ -2683,10 +2683,10 @@ def do_ssh(cs, args):
_quota_resources = ['instances', 'cores', 'ram', 'volumes', 'gigabytes',
- 'floating_ips', 'metadata_items', 'injected_files',
- 'key_pairs', 'injected_file_content_bytes',
- 'injected_file_path_bytes', 'security_groups',
- 'security_group_rules']
+ 'floating_ips', 'fixed_ips', 'metadata_items',
+ 'injected_files', 'key_pairs',
+ 'injected_file_content_bytes', 'injected_file_path_bytes',
+ 'security_groups', 'security_group_rules']
def _quota_show(quotas):
@@ -2767,6 +2767,11 @@ def do_quota_defaults(cs, args):
@utils.arg('--floating_ips',
type=int,
help=argparse.SUPPRESS)
+@utils.arg('--fixed-ips',
+ metavar='<fixed-ips>',
+ type=int,
+ default=None,
+ help='New value for the "fixed-ips" quota.')
@utils.arg('--metadata-items',
metavar='<metadata-items>',
type=int,
11 tests/v1_1/test_shell.py
View
@@ -1002,7 +1002,7 @@ def test_quota_defaults(self):
self.assert_called('GET',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353/defaults')
- def test_quota_defaults_no_nenant(self):
+ def test_quota_defaults_no_tenant(self):
self.run_command('quota-defaults')
self.assert_called('GET', '/os-quota-sets/tenant_id/defaults')
@@ -1013,6 +1013,15 @@ def test_quota_update(self):
self.assert_called('PUT',
'/os-quota-sets/97f4c221bff44578b0300df4ef119353')
+ def test_quota_update_fixed_ip(self):
+ self.run_command(
+ 'quota-update 97f4c221bff44578b0300df4ef119353'
+ ' --fixed-ips=5')
+ self.assert_called(
+ 'PUT', '/os-quota-sets/97f4c221bff44578b0300df4ef119353',
+ {'quota_set': {'fixed_ips': 5,
+ 'tenant_id': '97f4c221bff44578b0300df4ef119353'}})
+
def test_quota_class_show(self):
self.run_command('quota-class-show test')
self.assert_called('GET', '/os-quota-class-sets/test')
Please sign in to comment.
Something went wrong with that request. Please try again.