mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix async to use the new argfiles method (wrapping brain around rock, really must write module development guide)
This commit is contained in:
@@ -30,32 +30,10 @@ import traceback
|
||||
import shlex
|
||||
import os
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print json.dumps({
|
||||
"failed" : True,
|
||||
"msg" : "the command module requires arguments (-a)"
|
||||
})
|
||||
sys.exit(1)
|
||||
|
||||
argfile = sys.argv[1]
|
||||
if not os.path.exists(argfile):
|
||||
print json.dumps({
|
||||
"failed" : True,
|
||||
"msg" : "Argument file not found"
|
||||
})
|
||||
sys.exit(1)
|
||||
|
||||
args = open(argfile, 'r').read()
|
||||
args = shlex.split(args)
|
||||
|
||||
if not len(args):
|
||||
print json.dumps({
|
||||
"failed" : True,
|
||||
"msg" : "the command module requires arguments (-a)"
|
||||
})
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
startd = datetime.datetime.now()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user