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
This commit is contained in:
Martin Nečas 2019-02-19 19:42:10 +01:00 committed by ansibot
parent da77057566
commit 8d5811a611
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ovirt_network - fix getting network labels (https://github.com/ansible/ansible/pull/52499).

View file

@ -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: