Merge ~litios/ubuntu-cve-tracker:fix-tags-cve-publish into ubuntu-cve-tracker:master

Proposed by David Fernandez Gonzalez
Status: Merged
Merge reported by: David Fernandez Gonzalez
Merged at revision: ad27725929f829b623b40a9d5a0340e1f7ce1b03
Proposed branch: ~litios/ubuntu-cve-tracker:fix-tags-cve-publish
Merge into: ubuntu-cve-tracker:master
Diff against target: 28 lines (+9/-1)
1 file modified
scripts/publish-cves-to-website-api.py (+9/-1)
Reviewer Review Type Date Requested Status
Paulo Flabiano Smorigo Approve
Review via email: mp+438548@code.launchpad.net

Description of the change

When the CVE is loaded, Set is used for the tags. This doesn't work when serializing as JSON.

Replace all Set to Lists before sending the request.

To post a comment you must log in.
Revision history for this message
Paulo Flabiano Smorigo (pfsmorigo) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/publish-cves-to-website-api.py b/scripts/publish-cves-to-website-api.py
2index 1342eac..c8e1450 100755
3--- a/scripts/publish-cves-to-website-api.py
4+++ b/scripts/publish-cves-to-website-api.py
5@@ -41,6 +41,14 @@ def get_codename(raw_codename, cve_releases):
6
7 return get_devel_codename(cve_releases)
8
9+def get_tags(cve_data):
10+ tags = {}
11+ for pkg in cve_data['tags']:
12+ tags[pkg] = []
13+ for tag in cve_data['tags'][pkg]:
14+ tags[pkg].append(tag)
15+ return tags
16+
17 def get_patches(cve_data):
18 patches = {}
19 for pkg in cve_data['patches']:
20@@ -97,7 +105,7 @@ def post_single_cve(cve_filename):
21 impact = None
22
23 packages = []
24- tags = cve_data['tags']
25+ tags = get_tags(cve_data)
26 patches = get_patches(cve_data)
27 for pkg in cve_data["pkgs"]:
28 statuses = []

Subscribers

People subscribed via source and target branches