Merge ~allenpthuang/ubuntu-cve-tracker:fix-expand into ubuntu-cve-tracker:master

Proposed by Allen Huang
Status: Merged
Merged at revision: 022ef1f9e598171e96e6492d5908b04a94f5633f
Proposed branch: ~allenpthuang/ubuntu-cve-tracker:fix-expand
Merge into: ubuntu-cve-tracker:master
Diff against target: 30 lines (+1/-3)
1 file modified
scripts/oval_lib.py (+1/-3)
Reviewer Review Type Date Requested Status
Eduardo Barretto Approve
Amir Naseredini Approve
Review via email: mp+461277@code.launchpad.net

Commit message

Move `self.expand` before `self._load()` in `OvalGenerator`.

Description of the change

Move `self.expand` before its use in `self._load()` in `OvalGenerator`.
This was introduced under the radar because the children classes of
`OvalGenerator` had `self.expand` set before calling `super().__init__`.

To post a comment you must log in.
Revision history for this message
David Fernandez Gonzalez (litios) wrote :

+1 from my end, I also did this change on my local branch.

Revision history for this message
Amir Naseredini (sahnaseredini) wrote :

LGTM. thanks Allen.

review: Approve
Revision history for this message
Eduardo Barretto (ebarretto) wrote :

lgtm, thanks!

review: Approve
Revision history for this message
Eduardo Barretto (ebarretto) wrote (last edit ):

I've just merged PR 461249 you will need to rebase yours

review: Needs Fixing
Revision history for this message
Allen Huang (allenpthuang) wrote :

> I've just merged PR 461249 you will need to rebase yours

Rebased and updated, thanks!

Revision history for this message
Eduardo Barretto (ebarretto) wrote :

lgtm, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/oval_lib.py b/scripts/oval_lib.py
2index a974eaf..f51dbb1 100644
3--- a/scripts/oval_lib.py
4+++ b/scripts/oval_lib.py
5@@ -523,8 +523,8 @@ class OvalGenerator:
6 self.pkg_cache = pkg_cache
7 self.cve_paths = cve_paths
8 self.fixed_only = fixed_only
9- self.packages, self.cves = self._load(packages)
10 self.expand = expand
11+ self.packages, self.cves = self._load(packages)
12
13 def _init_ids(self, release):
14 # e.g. codename for trusty/esm should be trusty
15@@ -1323,7 +1323,6 @@ class OvalGenerator:
16
17 class OvalGeneratorPkg(OvalGenerator):
18 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg',expand=False) -> None:
19- self.expand = expand
20 super().__init__('pkg', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)
21
22 def _generate_advisory(self, package: Package) -> etree.Element:
23@@ -1529,7 +1528,6 @@ class OvalGeneratorPkg(OvalGenerator):
24
25 class OvalGeneratorCVE(OvalGenerator):
26 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg', expand=False) -> None:
27- self.expand = expand
28 super().__init__('cve', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)
29
30 # For CVE OVAL, the definition ID is generated

Subscribers

People subscribed via source and target branches