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:
parent
1f539e6601
commit
2a9daaa45b
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue