Modules don't have to return JSON, key=value pairs is ok.
This commit is contained in:
parent
be723aa98b
commit
475c38c941
1 changed files with 2 additions and 13 deletions
15
copy
15
copy
|
@ -22,11 +22,6 @@ import sys
|
|||
import os
|
||||
import shlex
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
# ===========================================
|
||||
# convert arguments of form a=b c=d
|
||||
# to a dictionary
|
||||
|
@ -51,10 +46,7 @@ dest = params['dest']
|
|||
|
||||
# raise an error if there is no src file
|
||||
if not os.path.exists(src):
|
||||
print json.dumps({
|
||||
"failed" : 1,
|
||||
"msg" : "Source %s failed to transfer" % src
|
||||
})
|
||||
print "failed=1 msg='Source %s failed to transfer'" % src
|
||||
sys.exit(1)
|
||||
|
||||
md5sum = None
|
||||
|
@ -70,9 +62,6 @@ if md5sum != md5sum2:
|
|||
changed = True
|
||||
|
||||
# mission accomplished
|
||||
print json.dumps({
|
||||
"md5sum" : md5sum2,
|
||||
"changed" : changed
|
||||
})
|
||||
print "md5sum=%s changed=%s" % (md5sum2, changed)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue