mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Ensure action plugins accept only valid args (#44779)
* Ensure action plugins accept only valid args This fixes #25424 This also fixes #44773 * Add missing parameters, use private _VALID_ARGS
This commit is contained in:
parent
33e9d67801
commit
bf9ed0263a
15 changed files with 61 additions and 13 deletions
|
@ -73,8 +73,8 @@ def clear_line(stdout):
|
|||
class ActionModule(ActionBase):
|
||||
''' pauses execution for a length or time, or until input is received '''
|
||||
|
||||
PAUSE_TYPES = ['seconds', 'minutes', 'prompt', 'echo', '']
|
||||
BYPASS_HOST_LOOP = True
|
||||
_VALID_ARGS = frozenset(('echo', 'minutes', 'prompt', 'seconds'))
|
||||
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
''' run the pause action module '''
|
||||
|
@ -100,11 +100,6 @@ class ActionModule(ActionBase):
|
|||
echo=echo
|
||||
))
|
||||
|
||||
if not set(self._task.args.keys()) <= set(self.PAUSE_TYPES):
|
||||
result['failed'] = True
|
||||
result['msg'] = "Invalid argument given. Must be one of: %s" % ", ".join(self.PAUSE_TYPES)
|
||||
return result
|
||||
|
||||
# Should keystrokes be echoed to stdout?
|
||||
if 'echo' in self._task.args:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue