mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
c661f9f561
commit
3922328954
1 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ def get_file_parser(hostsfile, groups, loader):
|
|||
parser = InventoryYAMLParser(loader=loader, groups=groups, filename=hostsfile)
|
||||
processed = True
|
||||
except Exception as e:
|
||||
myerr.append('Attempted to read "%s" as YAML: %s' % (hostsfile, to_native(e)))
|
||||
myerr.append('Attempted to read "%s" as YAML: %s' % (to_native(hostsfile), to_native(e)))
|
||||
|
||||
# ini
|
||||
if not processed and not shebang_present:
|
||||
|
@ -78,7 +78,7 @@ def get_file_parser(hostsfile, groups, loader):
|
|||
parser = InventoryINIParser(loader=loader, groups=groups, filename=hostsfile)
|
||||
processed = True
|
||||
except Exception as e:
|
||||
myerr.append('Attempted to read "%s" as ini file: %s ' % (hostsfile, to_native(e)))
|
||||
myerr.append('Attempted to read "%s" as ini file: %s ' % (to_native(hostsfile), to_native(e)))
|
||||
|
||||
if not processed and myerr:
|
||||
raise AnsibleError('\n'.join(myerr))
|
||||
|
|
Loading…
Reference in a new issue