From c5cc7224d912446e476bf195f860b3a0c31e9c9f Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 22 Oct 2018 15:41:18 +0530 Subject: [PATCH] nxos_file_copy fix for binary files (#46822) Signed-off-by: Trishna Guha (cherry picked from commit 9c81634c771c59292356dc0171e4383e7c382e77) --- lib/ansible/modules/network/nxos/nxos_file_copy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_file_copy.py b/lib/ansible/modules/network/nxos/nxos_file_copy.py index 97ff2bd599..106e916974 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -116,7 +116,7 @@ def md5sum_check(module, dst, file_system): local_file = module.params['local_file'] try: - with open(local_file, 'r') as f: + with open(local_file, 'rb') as f: filecontent = f.read() except (OSError, IOError) as exc: module.fail_json(msg="Error reading the file: %s" % to_text(exc))