Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge 6c71afa into e1c5d47
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonnnj committed Jan 20, 2022
2 parents e1c5d47 + 6c71afa commit 9dd5815
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mdyml/convert_cisagov.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ def convert() -> None:
"url": "https://github.com/cisagov/log4j-affected-db",
}
],
"software": data,
"software": sorted(
data, key=lambda p: (p["vendor"].lower(), p["product"].lower())
),
}

yaml = ruamel.yaml.YAML()
Expand Down
2 changes: 1 addition & 1 deletion src/yml/normalize_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def normalize(data: YamlData) -> YamlData:

def sort(data: YamlData) -> YamlData:
"""Sort the software entries."""
data["software"].sort(key=lambda x: (x["vendor"] + x["product"]).lower())
data["software"].sort(key=lambda x: (x["vendor"].lower(), x["product"].lower()))
return data


Expand Down

0 comments on commit 9dd5815

Please sign in to comment.