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
diff --git a/scripts/oval_lib.py b/scripts/oval_lib.py
index a974eaf..f51dbb1 100644
--- a/scripts/oval_lib.py
+++ b/scripts/oval_lib.py
@@ -523,8 +523,8 @@ class OvalGenerator:
523 self.pkg_cache = pkg_cache523 self.pkg_cache = pkg_cache
524 self.cve_paths = cve_paths524 self.cve_paths = cve_paths
525 self.fixed_only = fixed_only525 self.fixed_only = fixed_only
526 self.packages, self.cves = self._load(packages)
527 self.expand = expand526 self.expand = expand
527 self.packages, self.cves = self._load(packages)
528528
529 def _init_ids(self, release):529 def _init_ids(self, release):
530 # e.g. codename for trusty/esm should be trusty530 # e.g. codename for trusty/esm should be trusty
@@ -1323,7 +1323,6 @@ class OvalGenerator:
13231323
1324class OvalGeneratorPkg(OvalGenerator):1324class OvalGeneratorPkg(OvalGenerator):
1325 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg',expand=False) -> None:1325 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg',expand=False) -> None:
1326 self.expand = expand
1327 super().__init__('pkg', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)1326 super().__init__('pkg', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)
13281327
1329 def _generate_advisory(self, package: Package) -> etree.Element:1328 def _generate_advisory(self, package: Package) -> etree.Element:
@@ -1529,7 +1528,6 @@ class OvalGeneratorPkg(OvalGenerator):
15291528
1530class OvalGeneratorCVE(OvalGenerator):1529class OvalGeneratorCVE(OvalGenerator):
1531 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg', expand=False) -> None:1530 def __init__(self, releases, cve_paths, packages, progress, pkg_cache, fixed_only=True, cve_cache=None, outdir='./', oval_format='dpkg', expand=False) -> None:
1532 self.expand = expand
1533 super().__init__('cve', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)1531 super().__init__('cve', releases, cve_paths, packages, progress, pkg_cache, fixed_only, cve_cache, outdir, oval_format, expand)
15341532
1535 # For CVE OVAL, the definition ID is generated1533 # For CVE OVAL, the definition ID is generated

Subscribers

People subscribed via source and target branches