Don't observe reality if name property is None
We use `physical_resource_name` for name property in some resources when name not provided during create, so we shouldn't add name in resource_data if it's None in property (might just the cases that we using `physical_resource_name`). Closes-Bug: #1737696 Change-Id: I7b6bcfdd748fdb8664245c4b65ec7170c2ad4a94
This commit is contained in:
parent
d03514e3c8
commit
37bf1adfa7
|
@ -2207,6 +2207,13 @@ class Resource(status.ResourceStatus):
|
||||||
resource_result = {}
|
resource_result = {}
|
||||||
for key in self._update_allowed_properties:
|
for key in self._update_allowed_properties:
|
||||||
if key in resource_data:
|
if key in resource_data:
|
||||||
|
if key == 'name' and resource_properties.get(key) is None:
|
||||||
|
# We use `physical_resource_name` for name property in some
|
||||||
|
# resources when name not provided during create, so we
|
||||||
|
# shouldn't add name in resource_data if it's None in
|
||||||
|
# property (might just the cases that we using
|
||||||
|
# `physical_resource_name`).
|
||||||
|
continue
|
||||||
resource_result[key] = resource_data.get(key)
|
resource_result[key] = resource_data.get(key)
|
||||||
|
|
||||||
return resource_result
|
return resource_result
|
||||||
|
|
|
@ -334,7 +334,6 @@ class NeutronNetTest(common.HeatTestCase):
|
||||||
|
|
||||||
reality = rsrc.get_live_state(rsrc.properties)
|
reality = rsrc.get_live_state(rsrc.properties)
|
||||||
expected = {
|
expected = {
|
||||||
'name': 'net1-net-wkkl2vwupdee',
|
|
||||||
'admin_state_up': True,
|
'admin_state_up': True,
|
||||||
'qos_policy': "some",
|
'qos_policy': "some",
|
||||||
'value_specs': {
|
'value_specs': {
|
||||||
|
|
|
@ -819,7 +819,6 @@ class NeutronPortTest(common.HeatTestCase):
|
||||||
|
|
||||||
reality = port.get_live_state(port.properties)
|
reality = port.get_live_state(port.properties)
|
||||||
expected = {
|
expected = {
|
||||||
'name': 'flip-port-xjbal77qope3',
|
|
||||||
'allowed_address_pairs': [],
|
'allowed_address_pairs': [],
|
||||||
'admin_state_up': True,
|
'admin_state_up': True,
|
||||||
'device_owner': '',
|
'device_owner': '',
|
||||||
|
|
|
@ -855,7 +855,6 @@ class NeutronRouterTest(common.HeatTestCase):
|
||||||
'network': '1ede231a-0b46-40fc-ab3b-8029446d0d1b',
|
'network': '1ede231a-0b46-40fc-ab3b-8029446d0d1b',
|
||||||
'enable_snat': True
|
'enable_snat': True
|
||||||
},
|
},
|
||||||
'name': 'er-router-naqzmqnzk4ej',
|
|
||||||
'admin_state_up': True,
|
'admin_state_up': True,
|
||||||
'value_specs': {
|
'value_specs': {
|
||||||
'test_value_spec': 'spec_value'
|
'test_value_spec': 'spec_value'
|
||||||
|
|
|
@ -749,7 +749,6 @@ class NeutronSubnetTest(common.HeatTestCase):
|
||||||
|
|
||||||
reality = rsrc.get_live_state(rsrc.properties)
|
reality = rsrc.get_live_state(rsrc.properties)
|
||||||
expected = {
|
expected = {
|
||||||
'name': 'subnet-subnet-la5usdgifhrd',
|
|
||||||
'enable_dhcp': True,
|
'enable_dhcp': True,
|
||||||
'dns_nameservers': [],
|
'dns_nameservers': [],
|
||||||
'allocation_pools': [{'start': '10.0.0.2', 'end': '10.0.0.126'}],
|
'allocation_pools': [{'start': '10.0.0.2', 'end': '10.0.0.126'}],
|
||||||
|
|
Loading…
Reference in New Issue