Merge "Fix trailing space added at end of line in converted inventory"

This commit is contained in:
Jenkins
2017-01-24 21:40:36 +00:00
committed by Gerrit Code Review
3 changed files with 6 additions and 2 deletions

View File

@@ -191,6 +191,7 @@ def write_hostnames(save_path, hostnames_ips):
json.dumps(
hostnames_ips,
indent=4,
separators=(',', ': '),
sort_keys=True
)
)

View File

@@ -1074,6 +1074,7 @@ def main(config=None, check=False, debug=False, environment=None, **kwargs):
inventory_json = json.dumps(
inventory,
indent=4,
separators=(',', ': '),
sort_keys=True
)

View File

@@ -324,12 +324,14 @@ def main():
print(json.dumps(export_host_info(inventory), indent=2))
elif user_args['clear_ips'] is True:
remove_ip_addresses(inventory)
inventory_json = json.dumps(inventory, indent=2)
inventory_json = json.dumps(inventory, indent=2,
separators=(',', ': '))
filesys.save_inventory(inventory_json, filename)
print('Success. . .')
else:
du.recursive_dict_removal(inventory, user_args['remove_item'])
inventory_json = json.dumps(inventory, indent=2)
inventory_json = json.dumps(inventory, indent=2,
seprators=(',', ': '))
filesys.save_inventory(inventory_json, filename)
print('Success. . .')