From c35a36083d68fa70af9361926ecc705129102500 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 11 Aug 2022 10:56:39 -0700 Subject: [PATCH] ansible-console - Fix arg name to match base class. (#78502) --- changelogs/fragments/ansible-console-renamed-arg.yml | 3 +++ lib/ansible/cli/console.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/ansible-console-renamed-arg.yml diff --git a/changelogs/fragments/ansible-console-renamed-arg.yml b/changelogs/fragments/ansible-console-renamed-arg.yml new file mode 100644 index 00000000000..ebaa5b74ed7 --- /dev/null +++ b/changelogs/fragments/ansible-console-renamed-arg.yml @@ -0,0 +1,3 @@ +bugfixes: + - ansible-console - Renamed the first argument of ``ConsoleCLI.default`` from ``arg`` to ``line`` to match the first + argument of the same method on the base class ``Cmd``. diff --git a/lib/ansible/cli/console.py b/lib/ansible/cli/console.py index 45356aee2f0..3125cc47a7f 100755 --- a/lib/ansible/cli/console.py +++ b/lib/ansible/cli/console.py @@ -153,9 +153,9 @@ class ConsoleCLI(CLI, cmd.Cmd): def list_modules(self): return list_plugins('module', self.collections) - def default(self, arg, forceshell=False): + def default(self, line, forceshell=False): """ actually runs modules """ - if arg.startswith("#"): + if line.startswith("#"): return False if not self.cwd: @@ -164,10 +164,10 @@ class ConsoleCLI(CLI, cmd.Cmd): # defaults module = 'shell' - module_args = arg + module_args = line if forceshell is not True: - possible_module, *possible_args = arg.split() + possible_module, *possible_args = line.split() if module_loader.find_plugin(possible_module): # we found module! module = possible_module