Skip to content

Commit

Permalink
edited stringify helper function to sort dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sbreiff committed Feb 13, 2019
1 parent 59a9e93 commit 455ba09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions chalicelib/checks/audit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
def stringify(item):
if isinstance(item, str):
return item
else:
return str(item)
elif isinstance(item, list):
if len(item) == 1:
return stringify(item[0])
elif all(isinstance(i, dict) for i in item):
return str([sorted(i.items()) for i in item])
elif isinstance(item, dict):
return str(sorted(item.items()))
return str(item)


def compare_badges(obj_ids, item_type, badge, ffenv):
Expand Down

0 comments on commit 455ba09

Please sign in to comment.