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