From 63da877ba731ce9b6a244e61471f0c66b092f046 Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Wed, 28 Jun 2023 14:01:23 +1000 Subject: [PATCH 1/2] Allow running `admin show` arguments in check_mode The `show` command filter was unaware of `admin` class commands which are invoked by `admin show`. This patch fixes the problem to allow these commands in check mode. --- plugins/modules/iosxr_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/iosxr_command.py b/plugins/modules/iosxr_command.py index 5838de0da..2737e1ebc 100644 --- a/plugins/modules/iosxr_command.py +++ b/plugins/modules/iosxr_command.py @@ -152,7 +152,7 @@ def parse_commands(module, warnings): command = item["command"] except Exception: command = item - if module.check_mode and not command.startswith("show"): + if module.check_mode and not (command.startswith("show") or command.startswith("admin show")): warnings.append( "Only show commands are supported when using check mode, not " "executing %s" % command, From ae23d29aaea86264381dbe7d8b507769d0efd9a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 04:04:13 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugins/modules/iosxr_command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/modules/iosxr_command.py b/plugins/modules/iosxr_command.py index 2737e1ebc..d85f99d1f 100644 --- a/plugins/modules/iosxr_command.py +++ b/plugins/modules/iosxr_command.py @@ -152,7 +152,9 @@ def parse_commands(module, warnings): command = item["command"] except Exception: command = item - if module.check_mode and not (command.startswith("show") or command.startswith("admin show")): + if module.check_mode and not ( + command.startswith("show") or command.startswith("admin show") + ): warnings.append( "Only show commands are supported when using check mode, not " "executing %s" % command,