]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Hide ipv6 subnet API attributes
authorSalvatore Orlando <salv.orlando@gmail.com>
Mon, 7 Apr 2014 23:29:54 +0000 (16:29 -0700)
committerMark McClain <mmcclain@yahoo-inc.com>
Tue, 8 Apr 2014 13:13:18 +0000 (09:13 -0400)
The attributes for ra mode and address mode should be hidden
until the IPv6 feature is fully implemented.

The changes in this patch will be reverted by another patch
which closes this bug.

Change-Id: I69a1a571b5beb566641200e60b84f0716c1ec138
Related-Bug: 1304093

neutron/api/v2/attributes.py
neutron/db/db_base_plugin_v2.py
neutron/db/securitygroups_rpc_base.py
neutron/tests/unit/test_db_plugin.py
neutron/tests/unit/test_security_groups_rpc.py

index f5a23298b185018f1f1de234a6059716c03760b1..4560fbbb04e25a62e8a836116cc6c0fb75abf43c 100644 (file)
@@ -720,15 +720,17 @@ RESOURCE_ATTRIBUTE_MAP = {
                         'default': True,
                         'convert_to': convert_to_boolean,
                         'is_visible': True},
-        'ipv6_ra_mode': {'allow_post': True, 'allow_put': True,
+        # NOTE: The following two attributes will be made visible once IPv6
+        # will be fully supported
+        'ipv6_ra_mode': {'allow_post': False, 'allow_put': False,
                          'default': ATTR_NOT_SPECIFIED,
                          'validate': {'type:values': constants.IPV6_MODES},
-                         'is_visible': True},
-        'ipv6_address_mode': {'allow_post': True, 'allow_put': True,
+                         'is_visible': False},
+        'ipv6_address_mode': {'allow_post': False, 'allow_put': False,
                               'default': ATTR_NOT_SPECIFIED,
                               'validate': {'type:values':
                                            constants.IPV6_MODES},
-                              'is_visible': True},
+                              'is_visible': False},
         SHARED: {'allow_post': False,
                  'allow_put': False,
                  'default': False,
index 1be937cbaea81a9eb8d5c879774300b5fa6456b6..3210bd445e8954cf87951b319dbfc77aee922f52 100644 (file)
@@ -1158,9 +1158,9 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
                     'gateway_ip': s['gateway_ip'],
                     'shared': network.shared}
             if s['ip_version'] == 6 and s['enable_dhcp']:
-                if attributes.is_attr_set(s['ipv6_ra_mode']):
+                if attributes.is_attr_set(s.get('ipv6_ra_mode')):
                     args['ipv6_ra_mode'] = s['ipv6_ra_mode']
-                if attributes.is_attr_set(s['ipv6_address_mode']):
+                if attributes.is_attr_set(s.get('ipv6_address_mode')):
                     args['ipv6_address_mode'] = s['ipv6_address_mode']
             subnet = models_v2.Subnet(**args)
 
index 38d01fb22323cb2ed75d1ef26ddf4e3eee3db0dc..9f28ba6ddfb7ab0e4ac7bae3352864c5f04f42c7 100644 (file)
@@ -249,7 +249,7 @@ class SecurityGroupServerRpcCallbackMixin(object):
             # TODO(xuhanp): Figure out how to call the following code
             # each time router is created or updated.
             if not netaddr.IPAddress(gateway_ip).is_link_local():
-                if subnet['ipv6_ra_mode']:
+                if subnet.get('ipv6_ra_mode'):
                     gateway_ip = self._get_lla_gateway_ip_for_subnet(context,
                                                                      subnet)
                 else:
index 4369280200716b63148fd15f0090da52f16ae705..18d6026861caa91cfaada7c234eb9fd8127ee904 100644 (file)
@@ -22,6 +22,7 @@ import os
 import mock
 from oslo.config import cfg
 from testtools import matchers
+from testtools import testcase
 import webob.exc
 
 import neutron
@@ -2998,6 +2999,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
             res = subnet_req.get_response(self.api)
             self.assertEqual(res.status_int, webob.exc.HTTPClientError.code)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_create_subnet_ipv6_attributes(self):
         gateway_ip = 'fe80::1'
         cidr = 'fe80::/80'
@@ -3008,6 +3010,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
                                      ipv6_ra_mode=mode,
                                      ipv6_address_mode=mode)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_create_subnet_ipv6_attributes_no_dhcp_enabled(self):
         gateway_ip = 'fe80::1'
         cidr = 'fe80::/80'
@@ -3058,6 +3061,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
         self.assertEqual(ctx_manager.exception.code,
                          webob.exc.HTTPClientError.code)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_create_subnet_ipv6_single_attribute_set(self):
         gateway_ip = 'fe80::1'
         cidr = 'fe80::/80'
@@ -3232,6 +3236,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
                 self.assertEqual(res.status_int,
                                  webob.exc.HTTPConflict.code)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_update_subnet_ipv6_attributes(self):
         with self.subnet(ip_version=6, cidr='fe80::/80',
                          ipv6_ra_mode=constants.IPV6_SLAAC,
@@ -3246,6 +3251,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
             self.assertEqual(res['subnet']['ipv6_address_mode'],
                              data['subnet']['ipv6_address_mode'])
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_update_subnet_ipv6_inconsistent_ra_attribute(self):
         with self.subnet(ip_version=6, cidr='fe80::/80',
                          ipv6_ra_mode=constants.IPV6_SLAAC,
@@ -3257,6 +3263,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
             self.assertEqual(res.status_int,
                              webob.exc.HTTPClientError.code)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_update_subnet_ipv6_inconsistent_address_attribute(self):
         with self.subnet(ip_version=6, cidr='fe80::/80',
                          ipv6_ra_mode=constants.IPV6_SLAAC,
@@ -3268,6 +3275,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
             self.assertEqual(res.status_int,
                              webob.exc.HTTPClientError.code)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_update_subnet_ipv6_inconsistent_enable_dhcp(self):
         with self.subnet(ip_version=6, cidr='fe80::/80',
                          ipv6_ra_mode=constants.IPV6_SLAAC,
index 4d1710dd4b1adf124af6a7786bb03eebb20f585c..26124373d3792989ced1757a8ce684fe359dec96 100644 (file)
@@ -22,6 +22,7 @@ import mock
 from mock import call
 from oslo.config import cfg
 from testtools import matchers
+from testtools import testcase
 import webob.exc
 
 from neutron.agent.common import config
@@ -365,6 +366,7 @@ class SGServerRpcCallBackMixinTestCase(test_sg.SecurityGroupDBTestCase):
                                  expected)
                 self._delete('ports', port_id1)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_security_group_ra_rules_for_devices_ipv6_gateway_global(self):
         fake_prefix = FAKE_PREFIX[const.IPv6]
         fake_gateway = FAKE_IP['IPv6_GLOBAL']
@@ -435,6 +437,7 @@ class SGServerRpcCallBackMixinTestCase(test_sg.SecurityGroupDBTestCase):
                 self.deserialize(self.fmt, req.get_response(self.api))
                 self._delete('ports', gateway_port_id)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_security_group_rule_for_device_ipv6_multi_router_interfaces(self):
         fake_prefix = FAKE_PREFIX[const.IPv6]
         fake_gateway = FAKE_IP['IPv6_GLOBAL']
@@ -512,6 +515,7 @@ class SGServerRpcCallBackMixinTestCase(test_sg.SecurityGroupDBTestCase):
                 self._delete('ports', gateway_port_id)
                 self._delete('ports', interface_port_id)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_security_group_ra_rules_for_devices_ipv6_gateway_lla(self):
         fake_prefix = FAKE_PREFIX[const.IPv6]
         fake_gateway = FAKE_IP['IPv6_LLA']
@@ -564,6 +568,7 @@ class SGServerRpcCallBackMixinTestCase(test_sg.SecurityGroupDBTestCase):
                                  expected)
                 self._delete('ports', port_id1)
 
+    @testcase.skip("Skipped until bug 1304093 is fixed")
     def test_security_group_ra_rules_for_devices_ipv6_no_gateway_port(self):
         fake_prefix = FAKE_PREFIX[const.IPv6]
         with self.network() as n: