Skip to content

Commit 43ab621

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Neutron fixture: don't clobber profile and vif_details if empty" into stable/wallaby
2 parents 07c76bf + 83ca8b3 commit 43ab621

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

nova/tests/fixtures.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,16 +2034,19 @@ def update_port(self, port_id, body=None):
20342034
# else update the active one
20352035
host, _ = self._get_active_binding(port_id)
20362036

2037-
self._port_bindings[port_id][host] = {
2037+
update = {
20382038
'host': host,
20392039
'status': 'ACTIVE',
2040-
'profile': copy.deepcopy(
2041-
body['port'].get('binding:profile') or {},
2042-
),
2043-
'vif_details': port.get('binding:vif_details') or {},
20442040
'vif_type': port['binding:vif_type'],
20452041
'vnic_type': port['binding:vnic_type'],
20462042
}
2043+
if body['port'].get('binding:profile'):
2044+
update['profile'] = copy.deepcopy(
2045+
body['port']['binding:profile'])
2046+
if body['port'].get('binding:vif_details'):
2047+
update['vif_details'] = copy.deepcopy(
2048+
body['port']['binding:vif_details'])
2049+
self._port_bindings[port_id][host] = update
20472050

20482051
# mark any other active bindings as inactive
20492052
self._activate_port_binding(port_id, host)

0 commit comments

Comments
 (0)