ovirt_networks: Fix label assigment condition (#31772)

This commit is contained in:
Ondra Machacek 2017-10-16 10:58:51 +02:00 committed by ansibot
parent e648a00312
commit 052f4d2571

View file

@ -149,9 +149,11 @@ class NetworksModule(BaseModule):
self._update_label_assignments(entity) self._update_label_assignments(entity)
def _update_label_assignments(self, entity): def _update_label_assignments(self, entity):
if self.param('label') is None:
return
labels = [lbl.id for lbl in self._connection.follow_link(entity.network_labels)] labels = [lbl.id for lbl in self._connection.follow_link(entity.network_labels)]
labels_service = self._service.service(entity.id).network_labels_service() labels_service = self._service.service(entity.id).network_labels_service()
if not self.param('label') in labels: if not self.param('label') in labels:
if not self._module.check_mode: if not self._module.check_mode:
if labels: if labels: