Fix issue updating single segment networks
Updating single segment networks created with this module failed with: "Cannot update provider:physical_network in existing network" Single segment networks have the physical_network set at the network level. For multi-segment networks the physical_network is only set on the segments. Due to the incremental addition of support for multiple segments in THT the nameing convention for the base segment and additional segments are not identical. This change relaxes the test for physical_network change not allowed so that it accepts both naming conventions. Change-Id: Ie66907eb1953b671031bd42ad9e40760cfe1a84c
This commit is contained in:
parent
2e77f1f238
commit
feb3ce7e9a
|
@ -167,8 +167,8 @@ def validate_network_update(module, network, net_spec):
|
|||
# NOTE(hjensas): When a network have multiple segments,
|
||||
# attributes provider:network_type, provider:physical_network is None
|
||||
# for the network.
|
||||
if (network.provider_physical_network != net_spec.pop(
|
||||
'provider:physical_network')
|
||||
if (net_spec.pop('provider:physical_network')
|
||||
not in [network.provider_physical_network, net_spec['name']]
|
||||
and network.provider_physical_network is not None):
|
||||
module.fail_json(
|
||||
msg='Cannot update provider:physical_network in existing network')
|
||||
|
|
Loading…
Reference in New Issue