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
This commit is contained in:
Michael Scherer 2018-01-15 22:54:48 +01:00 committed by Adam Miller
parent 1f539e6601
commit 2a9daaa45b

View file

@ -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'):