Merge pull request #9707 from jimktrains/issue-9704-take2
Issue-9704 Better handling of missing python
This commit is contained in:
commit
0c65aa287c
3 changed files with 8 additions and 1 deletions
|
@ -192,6 +192,10 @@ class ActionModule(object):
|
|||
dest_file = conn.shell.join_path(dest, source_rel)
|
||||
remote_checksum = self.runner._remote_checksum(conn, tmp_path, dest_file, inject)
|
||||
|
||||
if remote_checksum == '4':
|
||||
result = dict(msg="python isn't present on the system. Unable to compute checksum", failed=True)
|
||||
return ReturnData(conn=conn, result=result)
|
||||
|
||||
if remote_checksum != '1' and not force:
|
||||
# remote_file does not exist so continue to next iteration.
|
||||
continue
|
||||
|
|
|
@ -129,7 +129,7 @@ class ActionModule(object):
|
|||
elif remote_checksum == '3':
|
||||
result = dict(msg="remote file is a directory, fetch cannot work on directories", file=source, changed=False)
|
||||
elif remote_checksum == '4':
|
||||
result = dict(msg="python isn't present on the remote system. Unable to fetch file", file=source, changed=False)
|
||||
result = dict(msg="python isn't present on the system. Unable to compute checksum", file=source, changed=False)
|
||||
return ReturnData(conn=conn, result=result)
|
||||
|
||||
# calculate checksum for the local file
|
||||
|
|
|
@ -83,6 +83,9 @@ class ActionModule(object):
|
|||
source = utils.path_dwim(self.runner.basedir, source)
|
||||
|
||||
remote_checksum = self.runner._remote_checksum(conn, tmp, dest, inject)
|
||||
if remote_checksum == '4':
|
||||
result = dict(failed=True, msg="python isn't present on the system. Unable to compute checksum")
|
||||
return ReturnData(conn=conn, result=result)
|
||||
if remote_checksum != '3':
|
||||
result = dict(failed=True, msg="dest '%s' must be an existing dir" % dest)
|
||||
return ReturnData(conn=conn, result=result)
|
||||
|
|
Loading…
Reference in a new issue