From 2a9daaa45b0252cd935c48b5d0ab4b581aa16e32 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 15 Jan 2018 22:54:48 +0100 Subject: [PATCH] Fix ansible-config with python3 (#34673) When using the -c option, like "ansible-config -c ~/.ansible.cfg view" with python 3, it fail with this error message: ERROR! Unsupported configuration file extension for b'/home/misc/.ansible.cfg': .cfg --- lib/ansible/config/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py index 49972adb68a..db9e08b57f0 100644 --- a/lib/ansible/config/manager.py +++ b/lib/ansible/config/manager.py @@ -116,7 +116,7 @@ def get_config_type(cfile): ftype = None if cfile is not None: - ext = os.path.splitext(cfile)[-1] + ext = to_text(os.path.splitext(cfile)[-1]) if ext in ('.ini', '.cfg'): ftype = 'ini' elif ext in ('.yaml', '.yml'):