From 9c81634c771c59292356dc0171e4383e7c382e77 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 --- 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 655f3cb6cf5..a0a9fc21751 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -191,7 +191,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))