Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt_host_networks: Fix label assignment #31969

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def has_update(self, nic_service):
update = False
bond = self._module.params['bond']
networks = self._module.params['networks']
labels = self._module.params['labels']
nic = get_entity(nic_service)

if nic is None:
Expand All @@ -209,6 +210,12 @@ def has_update(self, nic_service):
)
)

# Check if labels need to be updated on interface/bond:
if labels:
net_labels = nic_service.network_labels_service().list()
if sorted(labels) != sorted([lbl.id for lbl in net_labels]):
return True

if not networks:
return update

Expand Down Expand Up @@ -307,7 +314,7 @@ def main():
] if bond else None,
modified_labels=[
otypes.NetworkLabel(
name=str(name),
id=str(name),
host_nic=otypes.HostNic(
name=bond.get('name') if bond else interface
),
Expand Down