From 0302301dc8e196848f8eb3e3a88c8743ed2db677 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Wed, 29 Apr 2020 17:34:15 +0200 Subject: [PATCH] roles/cotainer_file_read: port to Python 3 Make it work on Python3, even if deprecated with the new `ssh_lxc` connection plugin. Now you can use directly the `slurp` native module with delegation to the lxc guest. May be useful only in case where it is impossible to get python3 or other ansible requirements on the lxc guest. --- library/container_file_read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/container_file_read.py b/library/container_file_read.py index 2a6c18d..eb25e21 100644 --- a/library/container_file_read.py +++ b/library/container_file_read.py @@ -30,7 +30,7 @@ def read_file_in_container(args): path = path, text = lines.read().strip('\n'), ) - except IOError, e: + except IOError as e: module.exit_json( msg = e, path = path,