From 7e997fdca2d099d117e160c6b764b3e39c738c38 Mon Sep 17 00:00:00 2001 From: chashtag <12386331+chashtag@users.noreply.github.com> Date: Thu, 16 May 2019 13:52:45 -0400 Subject: [PATCH] Update ovirt_vnic_profile.py (#56518) ##### SUMMARY 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 ##### ISSUE TYPE - Bugfix Pull Request +label: docsite_pr --- lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py b/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py index 14f1d42834..1ea66d22c9 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py @@ -217,7 +217,7 @@ class EntityVnicPorfileModule(BaseModule): equal(self.param('pass_through'), entity.pass_through.mode.name) 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)) )