Browse Source

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
changes/98/252698/1
Sridhar Ramaswamy 6 years ago
parent
commit
380e45bb7c
  1. 16
      tacker/tests/unit/vm/drivers/heat/test_heat.py
  2. 2
      tacker/vm/drivers/heat/heat.py

16
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)
self.assertEqual(device_obj, expected_device_update)

2
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', [])

Loading…
Cancel
Save