mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00: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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user