From a8820222804f3871e5bbcaa1afe32a03d2213b12 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 07:05:16 +0100 Subject: [PATCH] [PR #11589/d8bb637c backport][stable-12] nictagadm: don't call is_valid_mac when etherstub is true (#11618) nictagadm: don't call is_valid_mac when etherstub is true (#11589) * nictagadm: don't call is_valid_mac when etherstub is true * Add changelog fragment * update changelog fragment * Shorten changelog fragement * Update changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml --------- (cherry picked from commit d8bb637cba51ab15b9a14d7f81325f3a5f21270a) Co-authored-by: Adam D <44533090+emptyDir@users.noreply.github.com> Co-authored-by: Felix Fontein --- changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml | 3 +++ plugins/modules/nictagadm.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml 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":