mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-20 07:40:58 +00:00
when it is an IOError or an OSError - return a normal error message instead of a traceback barf
This commit is contained in:
@@ -17,6 +17,12 @@ try:
|
||||
cmd = subprocess.Popen(args, shell=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = cmd.communicate()
|
||||
except (OSError, IOError), e:
|
||||
print json.dumps({
|
||||
"failed": 1,
|
||||
"error": str(e),
|
||||
})
|
||||
sys.exit(1)
|
||||
except:
|
||||
print json.dumps({
|
||||
"failed" : 1,
|
||||
|
||||
Reference in New Issue
Block a user