From 53121eb647e99069a3946d34976369bf62f110dc Mon Sep 17 00:00:00 2001 From: GGabriele Date: Fri, 2 Sep 2016 18:55:17 +0200 Subject: [PATCH] Fix try/except --- network/nxos/nxos_file_copy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/network/nxos/nxos_file_copy.py b/network/nxos/nxos_file_copy.py index 555aca5e9d2..a59bf2453f2 100644 --- a/network/nxos/nxos_file_copy.py +++ b/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