ansible-console - Fix arg name to match base class. (#78502)

pull/78521/head
Matt Clay 3 years ago committed by GitHub
parent 0d3523df8f
commit c35a36083d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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``.

@ -153,9 +153,9 @@ class ConsoleCLI(CLI, cmd.Cmd):
def list_modules(self): def list_modules(self):
return list_plugins('module', self.collections) return list_plugins('module', self.collections)
def default(self, arg, forceshell=False): def default(self, line, forceshell=False):
""" actually runs modules """ """ actually runs modules """
if arg.startswith("#"): if line.startswith("#"):
return False return False
if not self.cwd: if not self.cwd:
@ -164,10 +164,10 @@ class ConsoleCLI(CLI, cmd.Cmd):
# defaults # defaults
module = 'shell' module = 'shell'
module_args = arg module_args = line
if forceshell is not True: if forceshell is not True:
possible_module, *possible_args = arg.split() possible_module, *possible_args = line.split()
if module_loader.find_plugin(possible_module): if module_loader.find_plugin(possible_module):
# we found module! # we found module!
module = possible_module module = possible_module

Loading…
Cancel
Save