ovirt_network: Fix update_check for cluster network role (#53318)

Currently if we didn't specify the "role" in the task which is already
available for the network, the update_check will return FALSE. The
patch fixes the same and update_check will only return FALSE if there
is any additonal role specified for the network that are not currently
available for the network.
This commit is contained in:
Nijin Ashok 2019-03-05 19:10:15 +05:30 committed by ansibot
parent a7eae0ae94
commit ff0285c6c4

View file

@ -241,18 +241,18 @@ class ClusterNetworksModule(BaseModule):
return (
equal(self._cluster_network.get('required'), entity.required) and
equal(self._cluster_network.get('display'), entity.display) and
equal(
sorted([
usage
for usage in ['display', 'gluster', 'migration']
if self._cluster_network.get(usage, False)
]),
sorted([
all(
x in [
str(usage)
for usage in getattr(entity, 'usages', [])
# VM + MANAGEMENT is part of root network
if usage != otypes.NetworkUsage.VM and usage != otypes.NetworkUsage.MANAGEMENT
]),
]
for x in [
usage
for usage in ['display', 'gluster', 'migration']
if self._cluster_network.get(usage, False)
]
)
)