mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
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
|
ftype = None
|
||||||
if cfile is not 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'):
|
if ext in ('.ini', '.cfg'):
|
||||||
ftype = 'ini'
|
ftype = 'ini'
|
||||||
elif ext in ('.yaml', '.yml'):
|
elif ext in ('.yaml', '.yml'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue