manatools / dnfdaemon

DBus daemon for doing package action with the dnf package manager
GNU General Public License v2.0
12 stars 16 forks source link

problems using GetConfig with DNF 2.0 #12

Closed anaselli closed 7 years ago

anaselli commented 7 years ago

As in issue #11 seems that GetConfig has similar problem:

(Pdb) p self.backend.GetConfig("*")
*** dnfdaemon.client.DaemonError: g-io-error-quark: GDBus.Error:org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python3.5/site-packages/dnfdaemon/server/__init__.py", line 83, in newFunc
    rc = func(*args, **kwargs)
  File "/usr/share/dnfdaemon/dnfdaemon-system", line 191, in GetConfig
    value = self.get_config(setting)
  File "/usr/lib/python3.5/site-packages/dnfdaemon/server/__init__.py", line 289, in get_config
    data = [(c, getattr(cfg, c)) for c in cfg.iterkeys()]
AttributeError: 'MainConf' object has no attribute 'iterkeys'
 (36)

while in Fedora without dnf 2.0:

(Pdb) p self.backend.GetConfig("*")
{'proxy': None, 'plugins': True, 'persistdir': '/var/lib/dnf', 'exclude': [], 'rpmverbosity': 'info', 'history_record': True, 'enabled': True, 'password': None, 'pluginconfpath': ['/etc/dnf/plugins'], 'color_list_available_downgrade': 'dim,cyan', 'sslverify': True, 'proxy_password': None, 'color_update_installed': 'normal', 'color_list_available_upgrade': 'bold,blue', 'proxy_username': None, 'minrate': 1000, 'username': None, 'obsoletes': True, 'reset_nice': True, 'sslcacert': None, 'sslclientkey': None, 'bugtracker_url': 'https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dnf', 'logdir': '/var/log', 'throttle': 0, 'disable_excludes': [], 'color_update_local': 'bold', 'color_list_installed_older': 'bold', 'cachedir': '/var/cache/dnf', 'diskspacecheck': True, 'metadata_timer_sync': 10800, 'strict': True, 'color_update_remote': 'normal', 'metadata_expire': 172800, 'max_parallel_downloads': None, 'assumeno': False, 'debug_solver': False, 'color_list_available_install': 'normal', 'color_list_installed_reinstall': 'normal', 'pluginpath': ['/usr/lib/python3.5/site-packages/dnf-plugins'], 'assumeyes': False, 'installonlypkgs': ['kernel', 'installonlypkg(kernel)', 'installonlypkg(kernel-module)', 'installonlypkg(vm)'], 'recent': 7, 'ip_resolve': None, 'fastestmirror': False, 'defaultyes': False, 'installroot': '/', 'alwaysprompt': True, 'color_list_installed_extra': 'bold,red', 'color_list_available_reinstall': 'bold,underline,green', 'keepcache': False, 'bandwidth': 0, 'color_list_installed_newer': 'bold,yellow', 'tsflags': [], 'include': [], 'repo_gpgcheck': False, 'installonly_limit': 3, 'history_record_packages': ['dnf', 'rpm'], 'color_search_match': 'bold', 'clean_requirements_on_remove': True, 'multilib_policy': 'best', 'enablegroups': True, 'timeout': 120, 'install_weak_deps': True, 'deltarpm': True, 'localpkg_gpgcheck': False, 'debuglevel': 2, 'sslclientcert': None, 'best': False, 'config_file_path': '/etc/dnf/dnf.conf', 'gpgcheck': True, 'reposdir': ['/etc/yum.repos.d', '/etc/yum/repos.d', '/etc/distro.repos.d'], 'color': 'auto', 'errorlevel': 2, 'showdupesfromrepos': False, 'history_list_view': 'commands'}
anaselli commented 7 years ago

Though if i pass a good key works: p self.backend.GetConfig("reposdir") ['/etc/yum.repos.d', '/etc/yum/repos.d', '/etc/distro.repos.d']

Conan-Kudo commented 7 years ago

Fixed in 085832aaa47475a865ff540e40fdc909d33814f4.