Skip to content

Commit

Permalink
Merge pull request #272 from actatux/fix/inventory_helper
Browse files Browse the repository at this point in the history
fix: make converter compatible with older PyYAML
  • Loading branch information
oxedions committed Jul 2, 2020
2 parents 9cd9248 + 4ecaccb commit dd3d905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/inventory-converter-1.3-network_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def main():

with open(hostsfile, 'r') as fd:
try:
inventory = yaml.load(fd, Loader=yaml.FullLoader)
inventory = yaml.load(fd, Loader=yaml.SafeLoader)
new_inventory = search_network_interfaces(inventory)
except yaml.YAMLError as exc:
print(exc)

with open(outfile, 'w') as fd:
fd.write(yaml.dump(new_inventory, Dumper=MyDumper))
fd.write(yaml.dump(new_inventory, Dumper=MyDumper, default_flow_style=False))

print(f'''Next steps:
$ diff -u {hostsfile} {outfile} | less
Expand Down

0 comments on commit dd3d905

Please sign in to comment.