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
pull/34897/merge
Michael Scherer 6 years ago committed by Adam Miller
parent 1f539e6601
commit 2a9daaa45b

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

Loading…
Cancel
Save