From 380e45bb7c45c7d9c5c8089b8298abbff4526dc5 Mon Sep 17 00:00:00 2001 From: Sridhar Ramaswamy Date: Thu, 3 Dec 2015 00:55:57 +0000 Subject: [PATCH] Use main port_security_enabled port propert instead of value_specs port_security_enabled flag is no supported anymore in Heat's value_specs property due to [1]. Move port_security_enabled into the main heat port resource property. [1] https://review.openstack.org/#/c/248719/ Change-Id: I08d9eb1880eceb7e0b59271a43f7c716159cfe66 Closes-Bug: 1522196 --- tacker/tests/unit/vm/drivers/heat/test_heat.py | 16 ++++++++-------- tacker/vm/drivers/heat/heat.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tacker/tests/unit/vm/drivers/heat/test_heat.py b/tacker/tests/unit/vm/drivers/heat/test_heat.py index 8a6216f76..14905c5e9 100644 --- a/tacker/tests/unit/vm/drivers/heat/test_heat.py +++ b/tacker/tests/unit/vm/drivers/heat/test_heat.py @@ -67,8 +67,8 @@ class TestDeviceHeat(testtools.TestCase): ' - port: {get_resource: vdu1-net_mgmt-port}\n - ' '{network: net0}\n - {network: net1}\n type: OS::Nova::' 'Server\n vdu1-net_mgmt-port:\n properties:\n fixed_ips: ' - '[]\n network: net_mgmt\n value_specs: {' - 'port_security_enabled: false}\n type: OS::Neutron::Port\n'} + '[]\n network: net_mgmt\n port_security_enabled: false\n' + ' type: OS::Neutron::Port\n'} def _get_expected_fields_user_data(self): return {'stack_name': 'tacker.vm.drivers.heat.heat_DeviceHeat-18685f68' @@ -87,8 +87,8 @@ class TestDeviceHeat(testtools.TestCase): 'df -h > /home/cirros/diskinfo\n\n \'\n ' 'user_data_format: RAW\n type: OS::Nova::Server\n ' 'vdu1-net_mgmt-port:\n properties:\n fixed_ips: []\n ' - 'network: net_mgmt\n value_specs: {port_security_enabled: ' - 'false}\n type: OS::Neutron::Port\n'} + 'network: net_mgmt\n port_security_enabled: false\n ' + 'type: OS::Neutron::Port\n'} def _get_expected_fields_ipaddr_data(self): return {'stack_name': 'tacker.vm.drivers.heat.heat_DeviceHeat-d1337add' @@ -105,13 +105,13 @@ class TestDeviceHeat(testtools.TestCase): '\n - port: {get_resource: vdu1-net1-port}\n type: ' 'OS::Nova::Server\n vdu1-net0-port:\n properties:\n ' 'fixed_ips:\n - {ip_address: 10.10.0.98}\n network: net0' - '\n value_specs: {port_security_enabled: false}\n type: ' + '\n port_security_enabled: false\n type: ' 'OS::Neutron::Port\n vdu1-net1-port:\n properties:\n ' 'fixed_ips:\n - {ip_address: 10.10.1.98}\n network: net1' - '\n value_specs: {port_security_enabled: false}\n type: ' + '\n port_security_enabled: false\n type: ' 'OS::Neutron::Port\n vdu1-net_mgmt-port:\n properties:\n ' 'fixed_ips:\n - {ip_address: 192.168.120.98}\n network: ' - 'net_mgmt\n value_specs: {port_security_enabled: false}\n ' + 'net_mgmt\n port_security_enabled: false\n ' 'type: OS::Neutron::Port\n'} def _get_expected_device_wait_obj(self): @@ -226,4 +226,4 @@ class TestDeviceHeat(testtools.TestCase): self.heat_driver.update(None, self.context, device_id, device_obj, device_config_obj) - self.assertEqual(device_obj, expected_device_update) \ No newline at end of file + self.assertEqual(device_obj, expected_device_update) diff --git a/tacker/vm/drivers/heat/heat.py b/tacker/vm/drivers/heat/heat.py index 66f048cc7..ba561efb6 100644 --- a/tacker/vm/drivers/heat/heat.py +++ b/tacker/vm/drivers/heat/heat.py @@ -148,7 +148,7 @@ class DeviceHeat(abstract_driver.DeviceAbstractDriver): port_dict = { 'type': 'OS::Neutron::Port', 'properties': { - 'value_specs': {'port_security_enabled': False} + 'port_security_enabled': False } } port_dict['properties'].setdefault('fixed_ips', [])