From 8d5811a611575ddc1e3a4bc6c80120e451dd0c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Tue, 19 Feb 2019 19:42:10 +0100 Subject: [PATCH] ovirt_network: ovirt fix getting labels (#52499) * ovirt fix getting labels * add changelog - ovirt_network_label_fail * add new line to changelog ovirt_network_label_fail --- changelogs/fragments/52499-ovirt_network_label_fail.yaml | 2 ++ lib/ansible/modules/cloud/ovirt/ovirt_network.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/52499-ovirt_network_label_fail.yaml diff --git a/changelogs/fragments/52499-ovirt_network_label_fail.yaml b/changelogs/fragments/52499-ovirt_network_label_fail.yaml new file mode 100644 index 00000000000..e19eb4974ee --- /dev/null +++ b/changelogs/fragments/52499-ovirt_network_label_fail.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ovirt_network - fix getting network labels (https://github.com/ansible/ansible/pull/52499). diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_network.py b/lib/ansible/modules/cloud/ovirt/ovirt_network.py index 647f9e4d637..d80972859e9 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_network.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_network.py @@ -184,8 +184,8 @@ class NetworksModule(BaseModule): if self.param('label') is None: return - labels = [lbl.id for lbl in self._connection.follow_link(entity.network_labels)] labels_service = self._service.service(entity.id).network_labels_service() + labels = [lbl.id for lbl in labels_service.list()] if not self.param('label') in labels: if not self._module.check_mode: if labels: