Skip to content

Commit

Permalink
1689169 - The libdnf 0.28 in Fedora 30 updates-testing changed the Co…
Browse files Browse the repository at this point in the history
…nfigParser interfaces.

Addressing
AttributeError: 'ConfigParser' object has no attribute 'data'
  • Loading branch information
adelton committed Mar 15, 2019
1 parent 1e6ac56 commit 716d24e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/dnf-plugins/swidtags.py
Expand Up @@ -11,7 +11,6 @@
from os import path, makedirs, environ, unlink, listdir, rmdir, symlink
import re
from rpm2swidtag import repodata
from configparser import ConfigParser

NAME = "swidtags"
RPM2SWIDTAG_COMMAND = "/usr/bin/rpm2swidtag"
Expand Down Expand Up @@ -130,10 +129,16 @@ def config(self):
}
for s in DEFAULTS:
if not self.conf.has_section(s):
self.conf.add_section(s)
try:
self.conf.addSection(s)
except AttributeError:
self.conf.add_section(s)
for o in DEFAULTS[s]:
if not self.conf.has_option(s, o):
self.conf.data[s][o] = DEFAULTS[s][o]
try:
self.conf.setValue(s, o, DEFAULTS[s][o])
except AttributeError:
self.conf.set(s, o, DEFAULTS[s][o])

for repo in self.base.repos.iter_enabled():
if hasattr(repo, "add_metadata_type_to_download"):
Expand Down

0 comments on commit 716d24e

Please sign in to comment.