2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Merge pull request #153 from Obihoernchen/json-dump-sort

Use natural sort for lists in json dumps
This commit is contained in:
Jarrod Johnson 2024-07-25 14:15:15 -04:00 committed by GitHub
commit fe6d44a4bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2647,7 +2647,7 @@ class ConfigManager(object):
dumpdata[confarea][element][attribute]['cryptvalue'] = '!'.join(cryptval)
elif isinstance(dumpdata[confarea][element][attribute], set):
dumpdata[confarea][element][attribute] = \
list(dumpdata[confarea][element][attribute])
confluent.util.natural_sort(list(dumpdata[confarea][element][attribute]))
return json.dumps(
dumpdata, sort_keys=True, indent=4, separators=(',', ': '))