|
|
@ -37,10 +37,6 @@ class ActionModule(object):
|
|
|
|
source = options.get('src', None)
|
|
|
|
source = options.get('src', None)
|
|
|
|
dest = options.get('dest', None)
|
|
|
|
dest = options.get('dest', None)
|
|
|
|
|
|
|
|
|
|
|
|
if dest.endswith("/"):
|
|
|
|
|
|
|
|
base = os.path.basename(source)
|
|
|
|
|
|
|
|
dest = os.path.join(dest, base)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (source is None and 'first_available_file' not in inject) or dest is None:
|
|
|
|
if (source is None and 'first_available_file' not in inject) or dest is None:
|
|
|
|
result = dict(failed=True, msg="src and dest are required")
|
|
|
|
result = dict(failed=True, msg="src and dest are required")
|
|
|
|
return ReturnData(conn=conn, comm_ok=False, result=result)
|
|
|
|
return ReturnData(conn=conn, comm_ok=False, result=result)
|
|
|
@ -62,6 +58,10 @@ class ActionModule(object):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
source = utils.template(self.runner.basedir, source, inject)
|
|
|
|
source = utils.template(self.runner.basedir, source, inject)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if dest.endswith("/"):
|
|
|
|
|
|
|
|
base = os.path.basename(source)
|
|
|
|
|
|
|
|
dest = os.path.join(dest, base)
|
|
|
|
|
|
|
|
|
|
|
|
# template the source data locally & transfer
|
|
|
|
# template the source data locally & transfer
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
resultant = utils.template_from_file(self.runner.basedir, source, inject)
|
|
|
|
resultant = utils.template_from_file(self.runner.basedir, source, inject)
|
|
|
|