mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
named actions + modules list in utils.py
This commit is contained in:
parent
dfaef8061a
commit
2063e10c00
3 changed files with 16 additions and 10 deletions
|
@ -17,9 +17,6 @@
|
|||
|
||||
from ansible import errors
|
||||
from ansible import utils
|
||||
import ansible.constants as C
|
||||
import os
|
||||
from os import pathsep
|
||||
|
||||
|
||||
class Task(object):
|
||||
|
@ -43,14 +40,8 @@ class Task(object):
|
|||
''' constructor loads from a task or handler datastructure '''
|
||||
|
||||
# code to allow for saying "modulename: args" versus "action: modulename args"
|
||||
|
||||
modules_list = set()
|
||||
for path in C.DEFAULT_MODULE_PATH.split(pathsep):
|
||||
if os.path.exists(path):
|
||||
modules_list.update(os.listdir(path))
|
||||
modules_list = list(modules_list)
|
||||
for x in ds.keys():
|
||||
if x in modules_list:
|
||||
if x in play.playbook.modules_list:
|
||||
ds['action'] = x + " " + ds.get(x, None)
|
||||
ds.pop(x)
|
||||
elif not x in Task.VALID_KEYS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue