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
This commit is contained in:
Martin Nečas 2019-07-31 19:32:03 +02:00 committed by Toshio Kuratomi
parent 703618336f
commit e2df33563c
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ovirt_vnic_profile - fix for updating vnic profile (https://github.com/ansible/ansible/pull/56518)

View file

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