1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Removed sort from json dump since response is a mix of strings and integers (#34217)

This commit is contained in:
ABond 2018-02-09 21:22:10 -05:00 committed by Abhijeet Kasurde
parent c119f6e642
commit 2940b9d5bb

View file

@ -313,7 +313,7 @@ class DigitalOceanInventory(object):
self.write_to_cache() self.write_to_cache()
if self.args.pretty: if self.args.pretty:
print(json.dumps(json_data, sort_keys=True, indent=2)) print(json.dumps(json_data, indent=2))
else: else:
print(json.dumps(json_data)) print(json.dumps(json_data))
@ -517,7 +517,7 @@ class DigitalOceanInventory(object):
def write_to_cache(self): def write_to_cache(self):
""" Writes data in JSON format to a file """ """ Writes data in JSON format to a file """
data = {'data': self.data, 'inventory': self.inventory} data = {'data': self.data, 'inventory': self.inventory}
json_data = json.dumps(data, sort_keys=True, indent=2) json_data = json.dumps(data, indent=2)
with open(self.cache_filename, 'w') as cache: with open(self.cache_filename, 'w') as cache:
cache.write(json_data) cache.write(json_data)