Fix error handling
This commit is contained in:
parent
3b266bf1e2
commit
0f606122bc
1 changed files with 4 additions and 3 deletions
|
@ -846,7 +846,7 @@ def transfer_file(module, dest):
|
|||
scp = SCPClient(ssh.get_transport())
|
||||
try:
|
||||
scp.put(module.params['local_file'], full_remote_path)
|
||||
except Exception as e:
|
||||
except:
|
||||
time.sleep(10)
|
||||
temp_size = verify_remote_file_exists(
|
||||
module, dest, file_system=module.params['file_system'])
|
||||
|
@ -894,8 +894,9 @@ def main():
|
|||
try:
|
||||
transfer_file(module, dest)
|
||||
transfer_status = 'Sent'
|
||||
except Exception as e:
|
||||
module.fail_json(msg=str(e))
|
||||
except ShellError:
|
||||
clie = get_exception():
|
||||
module.fail_json(msg=str(clie))
|
||||
|
||||
if remote_file is None:
|
||||
remote_file = os.path.basename(local_file)
|
||||
|
|
Loading…
Reference in a new issue