From e2df33563c6896d58b232cc7a652f23e4601b57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Wed, 31 Jul 2019 19:32:03 +0200 Subject: [PATCH] backport fix qos update ovirt_vnic_profile (#59862) Update ovirt_vnic_profile.py (#56518) qos is not defined when port_mirroring is enabled, a NoneType is returned for entity.qos in this case getattr is safer to use than using a direct call to entity.qos.name --- .../fragments/59862-ovirt-vnic-profile-qos-update-fix.yml | 2 ++ lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/59862-ovirt-vnic-profile-qos-update-fix.yml diff --git a/changelogs/fragments/59862-ovirt-vnic-profile-qos-update-fix.yml b/changelogs/fragments/59862-ovirt-vnic-profile-qos-update-fix.yml new file mode 100644 index 00000000000..345a1b5f85b --- /dev/null +++ b/changelogs/fragments/59862-ovirt-vnic-profile-qos-update-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - ovirt_vnic_profile - fix for updating vnic profile (https://github.com/ansible/ansible/pull/56518) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py b/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py index 5443676d24f..59e72058e6b 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py @@ -224,7 +224,7 @@ class EntityVnicPorfileModule(BaseModule): equal(self.param('pass_through'), getattr(entity.pass_through.mode, 'name', None)) and equal(self.param('description'), entity.description) and equal(self.param('network_filter'), getattr(entity.network_filter, 'name', None)) and - equal(self.param('qos'), entity.qos.name) and + equal(self.param('qos'), getattr(entity.qos, 'name', None)) and equal(self.param('port_mirroring'), getattr(entity, 'port_mirroring', None)) )