pull/59431/head
Martin Nečas 5 years ago committed by ansibot
parent 45d0e5994a
commit 279617a94e

@ -67,6 +67,7 @@ options:
description: description:
- "Enables passthrough to an SR-IOV-enabled host NIC." - "Enables passthrough to an SR-IOV-enabled host NIC."
- "When enabled C(qos) and C(network_filter) are automatically set to None and C(port_mirroring) to False." - "When enabled C(qos) and C(network_filter) are automatically set to None and C(port_mirroring) to False."
- "When enabled and C(migratable) not specified then C(migratable) is enabled."
- "Port mirroring, QoS and network filters are not supported on passthrough profiles." - "Port mirroring, QoS and network filters are not supported on passthrough profiles."
choices: ['disabled', 'enabled'] choices: ['disabled', 'enabled']
migratable: migratable:
@ -242,6 +243,8 @@ class EntityVnicPorfileModule(BaseModule):
pass_through = getattr(entity.pass_through.mode, 'name', None) pass_through = getattr(entity.pass_through.mode, 'name', None)
return ( return (
check_custom_properties() and check_custom_properties() and
# The reason why we can't use equal method, is we get None from _get_network_filter_id or _get_qos_id method, when passing empty string.
# And when first param of equal method is None it retruns true.
self._get_network_filter_id() == getattr(entity.network_filter, 'id', None) and self._get_network_filter_id() == getattr(entity.network_filter, 'id', None) and
self._get_qos_id() == getattr(entity.qos, 'id', None) and self._get_qos_id() == getattr(entity.qos, 'id', None) and
equal(self.param('migratable'), getattr(entity, 'migratable', None)) and equal(self.param('migratable'), getattr(entity, 'migratable', None)) and

Loading…
Cancel
Save