dnf - replace usage of private attribute with supported API (#73529)
base._update_security_filters is a private attribute of DNF used as performance optimization. Modification or even call from outside of DNF is against all recommendation including PEP8. * Improve compatibility with all DNF versions * Add changelog fragment for dnf security change
This commit is contained in:
parent
ba2b1a6bf6
commit
d9183b8df5
2 changed files with 21 additions and 9 deletions
2
changelogs/fragments/dnf-security.yaml
Normal file
2
changelogs/fragments/dnf-security.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Replace usage of private dnf.Base() attribute by future dnf API
|
|
@ -687,6 +687,16 @@ class DnfModule(YumDnf):
|
||||||
rc=1
|
rc=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_security_filters = getattr(base, "add_security_filters", None)
|
||||||
|
if callable(add_security_filters):
|
||||||
|
filters = {}
|
||||||
|
if self.bugfix:
|
||||||
|
filters.setdefault('types', []).append('bugfix')
|
||||||
|
if self.security:
|
||||||
|
filters.setdefault('types', []).append('security')
|
||||||
|
if filters:
|
||||||
|
add_security_filters('eq', **filters)
|
||||||
|
else:
|
||||||
filters = []
|
filters = []
|
||||||
if self.bugfix:
|
if self.bugfix:
|
||||||
key = {'advisory_type__eq': 'bugfix'}
|
key = {'advisory_type__eq': 'bugfix'}
|
||||||
|
|
Loading…
Reference in a new issue