Modules don't have to return JSON, key=value pairs is ok.

This commit is contained in:
Michael DeHaan 2012-03-14 21:16:15 -04:00
parent be723aa98b
commit 475c38c941

15
copy
View file

@ -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)