Bug 1692044 - libdnf ConfigParser implementation breaks dnf-plugin-spacewalk
Summary: libdnf ConfigParser implementation breaks dnf-plugin-spacewalk
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: 29
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Jaroslav Rohel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-23 16:58 UTC by Neal Gompa
Modified: 2019-03-31 03:00 UTC (History)
11 users (show)

Fixed In Version: libdnf-0.28.1-1.fc30 libdnf-0.28.1-1.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-31 00:04:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Neal Gompa 2019-03-23 16:58:36 UTC
Description of problem:
Since the update to dnf 4.2.1 and libdnf 0.28.0, the Spacewalk plugin is no longer compatible with DNF, and now DNF crashes whenever it tries to run anything, since the plugin fails to load because the ConfigParser implementation is incomplete compared to the old iniparse implementation.

Version-Release number of selected component (if applicable):
0.28.0-1.fc29

How reproducible:
Always

Steps to Reproduce:
1. Install dnf-plugin-spacewalk
2. Run "dnf status"

Actual results:

Crashes with traceback:
$ dnf status
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 192, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 95, in _main
    cli.configure(list(map(ucd, args)), option_parser())
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 902, in configure
    self.base.init_plugins(opts.disableplugin, opts.enableplugin, self)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 316, in init_plugins
    self._plugins._run_init(self, cli)
  File "/usr/lib/python3.7/site-packages/dnf/plugin.py", line 149, in _run_init
    plugin = p_cls(base, cli)
  File "/usr/lib/python3.7/site-packages/dnf-plugins/spacewalk.py", line 68, in __init__
    options = self.parser.items("main")
  File "/usr/lib64/python3.7/site-packages/libdnf/conf.py", line 1826, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, ConfigParser, name)
  File "/usr/lib64/python3.7/site-packages/libdnf/conf.py", line 80, in _swig_getattr
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'ConfigParser' object has no attribute 'items'


Expected results:
DNF loads properly.

Additional info:

Comment 1 Neal Gompa 2019-03-23 17:02:10 UTC
While this is technically also a dnf-plugin-spacewalk bug, I think the expectation is that libdnf is supposed to provide a fully compatible API for this, so I switched the component back to libdnf.

Comment 2 Neal Gompa 2019-03-23 17:04:03 UTC
For the record, this is reproducible with dnf-plugin-spacewalk 2.9.7, dnf 4.2.1, and libdnf 0.28.0. Downgrading to dnf 4.1.0 and libdnf 0.22.0 fixes this issue, since it reverts back to the old python-iniparse based implementation for config parsing.

Comment 3 Jaroslav Rohel 2019-03-25 07:17:29 UTC
Fixed in 
PR https://github.com/rpm-software-management/libdnf/pull/704

Comment 4 Fedora Update System 2019-03-27 13:37:23 UTC
dnf-4.2.2-1.fc30 librepo-1.9.6-1.fc30 libdnf-0.28.1-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-b504d6ad8f

Comment 5 Fedora Update System 2019-03-27 13:37:47 UTC
dnf-4.2.2-1.fc29 librepo-1.9.6-1.fc29 libdnf-0.28.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-7fbfa37585

Comment 6 Fedora Update System 2019-03-27 18:18:29 UTC
dnf-4.2.2-1.fc30, libdnf-0.28.1-1.fc30, librepo-1.9.6-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-b504d6ad8f

Comment 7 Fedora Update System 2019-03-27 20:01:59 UTC
dnf-4.2.2-1.fc29, libdnf-0.28.1-1.fc29, librepo-1.9.6-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-7fbfa37585

Comment 8 Fedora Update System 2019-03-31 00:04:13 UTC
dnf-4.2.2-1.fc30, libdnf-0.28.1-1.fc30, librepo-1.9.6-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2019-03-31 03:00:48 UTC
dnf-4.2.2-1.fc29, libdnf-0.28.1-1.fc29, librepo-1.9.6-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.