diff --git a/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json b/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json index e5748a4cd36..6e477722dda 100644 --- a/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json +++ b/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json @@ -1,7 +1,7 @@ { "quota_class_set": { "cores": 20, - "fixed_ips": 10, + "fixed_ips": -1, "floating_ips": 10, "id": "test_class", "injected_file_content_bytes": 10240, @@ -14,4 +14,4 @@ "security_group_rules": 20, "security_groups": 10 } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml b/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml index 8e7444634aa..91929d34ad2 100644 --- a/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml +++ b/doc/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml @@ -1,7 +1,7 @@ 20 - 10 + -1 10 10240 255 @@ -12,4 +12,4 @@ 51200 20 10 - \ No newline at end of file + diff --git a/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json b/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json index 6325bb562e8..c86f86063b8 100644 --- a/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json +++ b/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json @@ -1,7 +1,7 @@ { "quota_class_set": { "cores": 50, - "fixed_ips": 10, + "fixed_ips": -1, "floating_ips": 10, "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, @@ -13,4 +13,4 @@ "security_group_rules": 20, "security_groups": 10 } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml b/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml index 26a29fc2302..23eb5088c76 100644 --- a/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml +++ b/doc/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml @@ -1,7 +1,7 @@ 50 - 10 + -1 10 10240 255 @@ -12,4 +12,4 @@ 51200 20 10 - \ No newline at end of file + diff --git a/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json b/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json index efc35cf0023..239c64d23d4 100644 --- a/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json +++ b/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json @@ -1,7 +1,7 @@ { "quota_set": { "cores": 20, - "fixed_ips": 10, + "fixed_ips": -1, "floating_ips": 10, "id": "fake_tenant", "injected_file_content_bytes": 10240, @@ -14,4 +14,4 @@ "security_group_rules": 20, "security_groups": 10 } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml b/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml index dd4c6d66d22..76a9292c137 100644 --- a/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml +++ b/doc/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml @@ -1,7 +1,7 @@ 20 - 10 + -1 10 10240 255 @@ -12,4 +12,4 @@ 51200 20 10 - \ No newline at end of file + diff --git a/doc/api_samples/os-quota-sets/quotas-show-get-resp.json b/doc/api_samples/os-quota-sets/quotas-show-get-resp.json index efc35cf0023..239c64d23d4 100644 --- a/doc/api_samples/os-quota-sets/quotas-show-get-resp.json +++ b/doc/api_samples/os-quota-sets/quotas-show-get-resp.json @@ -1,7 +1,7 @@ { "quota_set": { "cores": 20, - "fixed_ips": 10, + "fixed_ips": -1, "floating_ips": 10, "id": "fake_tenant", "injected_file_content_bytes": 10240, @@ -14,4 +14,4 @@ "security_group_rules": 20, "security_groups": 10 } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-quota-sets/quotas-show-get-resp.xml b/doc/api_samples/os-quota-sets/quotas-show-get-resp.xml index dd4c6d66d22..76a9292c137 100644 --- a/doc/api_samples/os-quota-sets/quotas-show-get-resp.xml +++ b/doc/api_samples/os-quota-sets/quotas-show-get-resp.xml @@ -1,7 +1,7 @@ 20 - 10 + -1 10 10240 255 @@ -12,4 +12,4 @@ 51200 20 10 - \ No newline at end of file + diff --git a/doc/api_samples/os-quota-sets/quotas-update-post-resp.json b/doc/api_samples/os-quota-sets/quotas-update-post-resp.json index 14324e36531..2be76d47215 100644 --- a/doc/api_samples/os-quota-sets/quotas-update-post-resp.json +++ b/doc/api_samples/os-quota-sets/quotas-update-post-resp.json @@ -1,7 +1,7 @@ { "quota_set": { "cores": 20, - "fixed_ips": 10, + "fixed_ips": -1, "floating_ips": 10, "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, @@ -13,4 +13,4 @@ "security_group_rules": 20, "security_groups": 45 } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-quota-sets/quotas-update-post-resp.xml b/doc/api_samples/os-quota-sets/quotas-update-post-resp.xml index 5e6bb893e29..e03a0bf5e4b 100644 --- a/doc/api_samples/os-quota-sets/quotas-update-post-resp.xml +++ b/doc/api_samples/os-quota-sets/quotas-update-post-resp.xml @@ -1,7 +1,7 @@ 20 - 10 + -1 10 10240 255 @@ -12,4 +12,4 @@ 51200 20 45 - \ No newline at end of file + diff --git a/nova/quota.py b/nova/quota.py index 3903a6add62..8aaa3ed31db 100644 --- a/nova/quota.py +++ b/nova/quota.py @@ -44,7 +44,7 @@ default=10, help='number of floating ips allowed per project'), cfg.IntOpt('quota_fixed_ips', - default=10, + default=-1, help=('number of fixed ips allowed per project (this should be ' 'at least the number of instances allowed)')), cfg.IntOpt('quota_metadata_items', diff --git a/nova/tests/api/openstack/compute/contrib/test_quota_classes.py b/nova/tests/api/openstack/compute/contrib/test_quota_classes.py index 8286661a014..c4f79118e01 100644 --- a/nova/tests/api/openstack/compute/contrib/test_quota_classes.py +++ b/nova/tests/api/openstack/compute/contrib/test_quota_classes.py @@ -25,7 +25,7 @@ def quota_set(class_name): return {'quota_class_set': {'id': class_name, 'metadata_items': 128, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'instances': 10, + 'fixed_ips': -1, 'instances': 10, 'injected_files': 5, 'cores': 20, 'injected_file_content_bytes': 10240, 'security_groups': 10, @@ -45,7 +45,7 @@ def test_format_quota_set(self): 'cores': 20, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_path_bytes': 255, @@ -64,7 +64,7 @@ def test_format_quota_set(self): self.assertEqual(qs['cores'], 20) self.assertEqual(qs['ram'], 51200) self.assertEqual(qs['floating_ips'], 10) - self.assertEqual(qs['fixed_ips'], 10) + self.assertEqual(qs['fixed_ips'], -1) self.assertEqual(qs['metadata_items'], 128) self.assertEqual(qs['injected_files'], 5) self.assertEqual(qs['injected_file_path_bytes'], 255) @@ -90,7 +90,7 @@ def test_quotas_show_as_unauthorized_user(self): def test_quotas_update_as_admin(self): body = {'quota_class_set': {'instances': 50, 'cores': 50, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'injected_file_path_bytes': 255, @@ -108,7 +108,7 @@ def test_quotas_update_as_admin(self): def test_quotas_update_as_user(self): body = {'quota_class_set': {'instances': 50, 'cores': 50, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'security_groups': 10, @@ -136,7 +136,7 @@ def test_serializer(self): injected_file_content_bytes=20, ram=50, floating_ips=60, - fixed_ips=10, + fixed_ips=-1, instances=70, injected_files=80, security_groups=10, @@ -161,7 +161,7 @@ def test_deserializer(self): injected_file_content_bytes='20', ram='50', floating_ips='60', - fixed_ips='10', + fixed_ips='-1', instances='70', injected_files='80', security_groups='10', @@ -175,7 +175,7 @@ def test_deserializer(self): '' '50' '60' - '10' + '-1' '70' '80' '90' diff --git a/nova/tests/api/openstack/compute/contrib/test_quotas.py b/nova/tests/api/openstack/compute/contrib/test_quotas.py index 1ff7e60abc0..c95c41614fb 100644 --- a/nova/tests/api/openstack/compute/contrib/test_quotas.py +++ b/nova/tests/api/openstack/compute/contrib/test_quotas.py @@ -26,7 +26,7 @@ def quota_set(id): return {'quota_set': {'id': id, 'metadata_items': 128, - 'ram': 51200, 'floating_ips': 10, 'fixed_ips': 10, + 'ram': 51200, 'floating_ips': 10, 'fixed_ips': -1, 'instances': 10, 'injected_files': 5, 'cores': 20, 'injected_file_content_bytes': 10240, 'security_groups': 10, 'security_group_rules': 20, @@ -45,7 +45,7 @@ def test_format_quota_set(self): 'cores': 20, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_path_bytes': 255, @@ -62,7 +62,7 @@ def test_format_quota_set(self): self.assertEqual(qs['cores'], 20) self.assertEqual(qs['ram'], 51200) self.assertEqual(qs['floating_ips'], 10) - self.assertEqual(qs['fixed_ips'], 10) + self.assertEqual(qs['fixed_ips'], -1) self.assertEqual(qs['metadata_items'], 128) self.assertEqual(qs['injected_files'], 5) self.assertEqual(qs['injected_file_path_bytes'], 255) @@ -83,7 +83,7 @@ def test_quotas_defaults(self): 'cores': 20, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_path_bytes': 255, @@ -109,13 +109,13 @@ def test_quotas_show_as_unauthorized_user(self): def test_quotas_update_as_admin(self): body = {'quota_set': {'instances': 50, 'cores': 50, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'injected_file_path_bytes': 255, 'security_groups': 10, 'security_group_rules': 20, - 'key_pairs': 100, 'fixed_ips': 10}} + 'key_pairs': 100, 'fixed_ips': -1}} req = fakes.HTTPRequest.blank('/v2/fake4/os-quota-sets/update_me', use_admin_context=True) @@ -126,7 +126,7 @@ def test_quotas_update_as_admin(self): def test_quotas_update_as_user(self): body = {'quota_set': {'instances': 50, 'cores': 50, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'security_groups': 10, @@ -163,7 +163,7 @@ def test_quotas_update_invalid_value(self): expected_resp = {'quota_set': { 'instances': 50, 'cores': 50, 'ram': 51200, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'injected_file_path_bytes': 255, @@ -174,7 +174,7 @@ def test_quotas_update_invalid_value(self): # when PUT JSON format with empty string for quota body = {'quota_set': {'instances': 50, 'cores': 50, 'ram': '', 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'injected_file_path_bytes': 255, @@ -189,7 +189,7 @@ def test_quotas_update_invalid_value(self): # when PUT XML format with empty string for quota body = {'quota_set': {'instances': 50, 'cores': 50, 'ram': {}, 'floating_ips': 10, - 'fixed_ips': 10, 'metadata_items': 128, + 'fixed_ips': -1, 'metadata_items': 128, 'injected_files': 5, 'injected_file_content_bytes': 10240, 'injected_file_path_bytes': 255, @@ -216,7 +216,7 @@ def test_serializer(self): injected_file_content_bytes=20, ram=50, floating_ips=60, - fixed_ips=10, + fixed_ips=-1, instances=70, injected_files=80, security_groups=10, @@ -240,7 +240,7 @@ def test_deserializer(self): injected_file_content_bytes='20', ram='50', floating_ips='60', - fixed_ips='10', + fixed_ips='-1', instances='70', injected_files='80', security_groups='10', @@ -254,7 +254,7 @@ def test_deserializer(self): '' '50' '60' - '10' + '-1' '70' '80' '10' diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl index c393ab0c7ea..f9a94e760af 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl @@ -2,7 +2,7 @@ "quota_class_set": { "cores": 20, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "id": "%(set_id)s", "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl index 8ab8436d7b5..fb8e7992a51 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl @@ -2,7 +2,7 @@ 20 10 - 10 + -1 10240 255 5 diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl index 3974f65db5f..483fda8c53e 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl @@ -4,7 +4,7 @@ "cores": 50, "ram": 51200, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "metadata_items": 128, "injected_files": 5, "injected_file_content_bytes": 10240, diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl index f27082ab356..150fb6a42a7 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl @@ -2,7 +2,7 @@ 50 10 - 10 + -1 10240 255 5 diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl index 8d195b92408..c36783f2f0e 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl @@ -2,7 +2,7 @@ "quota_class_set": { "cores": 50, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, "injected_files": 5, @@ -13,4 +13,4 @@ "security_group_rules": 20, "security_groups": 10 } -} \ No newline at end of file +} diff --git a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl index 5c12a81e7f2..cd674a24dab 100644 --- a/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl @@ -2,7 +2,7 @@ 50 10 - 10 + -1 10240 255 5 @@ -12,4 +12,4 @@ 51200 20 10 - \ No newline at end of file + diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl index 364a59f7a07..2f0fd985724 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl @@ -2,7 +2,7 @@ "quota_set": { "cores": 20, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "id": "fake_tenant", "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl index 36e6da5445f..f56987563ce 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl @@ -2,7 +2,7 @@ 20 10 - 10 + -1 10240 255 5 diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl index 364a59f7a07..2f0fd985724 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl @@ -2,7 +2,7 @@ "quota_set": { "cores": 20, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "id": "fake_tenant", "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl index 36e6da5445f..f56987563ce 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl @@ -2,7 +2,7 @@ 20 10 - 10 + -1 10240 255 5 diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl index 43525cfd5df..34df1fe01e9 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl @@ -2,7 +2,7 @@ "quota_set": { "cores": 20, "floating_ips": 10, - "fixed_ips": 10, + "fixed_ips": -1, "injected_file_content_bytes": 10240, "injected_file_path_bytes": 255, "injected_files": 5, diff --git a/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl index 3c411e8e55e..91ac3a0dda6 100644 --- a/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl @@ -2,7 +2,7 @@ 20 10 - 10 + -1 10240 255 5