From aabab30a4f9b7089847c0c3dd053100708e6dd25 Mon Sep 17 00:00:00 2001 From: GGabriele Date: Fri, 2 Sep 2016 18:55:17 +0200 Subject: [PATCH] Fix try/except --- lib/ansible/modules/network/nxos/nxos_file_copy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_file_copy.py b/lib/ansible/modules/network/nxos/nxos_file_copy.py index 00c5757112b..6ec37ab3fc1 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -855,10 +855,9 @@ def transfer_file(module, dest): else: module.fail_json(msg='Could not transfer file. There was an error ' 'during transfer. Please make sure remote ' - 'permissions are set.', temp_size=temp_size, file_size=file_size) - finally: - scp.close() - + 'permissions are set.', temp_size=temp_size, + file_size=file_size) + scp.close() return True