diff --git a/changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml b/changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml new file mode 100644 index 0000000000..717bb7654b --- /dev/null +++ b/changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml @@ -0,0 +1,3 @@ +bugfixes: + - nictagadm - add a condition to the if statement so that ``is_valid_mac()`` does not get called if ``etherstub`` is false + (https://github.com/ansible-collections/community.general/pull/11589). diff --git a/plugins/modules/nictagadm.py b/plugins/modules/nictagadm.py index 772a1d81ef..59cc3427d5 100644 --- a/plugins/modules/nictagadm.py +++ b/plugins/modules/nictagadm.py @@ -193,7 +193,7 @@ def main(): state=nictag.state, ) - if not nictag.is_valid_mac(): + if not nictag.etherstub and not nictag.is_valid_mac(): module.fail_json(msg="Invalid MAC Address Value", name=nictag.name, mac=nictag.mac, etherstub=nictag.etherstub) if nictag.state == "absent":