Remove shell module specialcases

Shell is implemented via the command module.  There was a special case
in mod_args to do that.  Make shell into an action plugin to handle that
instead.

Also move the special case for the command nanny into a command module
action plugin.  This is more appropriate as we then do not have to send
a parameter that is only for the command module to every single module.
This commit is contained in:
Toshio Kuratomi 2017-12-21 10:45:33 -08:00
parent 39800e1390
commit 235bdfb996
8 changed files with 125 additions and 103 deletions

View file

@ -116,21 +116,6 @@ class ModuleArgsParser:
else:
return (tokens[0], "")
def _handle_shell_weirdness(self, action, args):
'''
given an action name and an args dictionary, return the
proper action name and args dictionary. This mostly is due
to shell/command being treated special and nothing else
'''
# the shell module really is the command module with an additional
# parameter
if action == 'shell':
action = 'command'
args['_uses_shell'] = True
return (action, args)
def _normalize_parameters(self, thing, action=None, additional_args=None):
'''
arguments can be fuzzy. Deal with all the forms.
@ -319,7 +304,4 @@ class ModuleArgsParser:
", ".join(RAW_PARAM_MODULES)),
obj=self._task_ds)
# shell modules require special handling
(action, args) = self._handle_shell_weirdness(action, args)
return (action, args, delegate_to)