FreeIPA currently uses python3-dbus API which is deprecated for a decade now and is wished for a removal by GNOME developers. While this is not going to happen in Fedora 32, we need to prepare.
FreeIPA uses D-BUS to communicate with the following external processes: - certmonger - oddjob helpers - SSSD
Below is a sample Python code that uses GIO to communicate with certmonger over the system bus (run as root) to enumerate certificates:
from gi.repository import Gio, GLib DBUS_CM_PATH = '/org/fedorahosted/certmonger' DBUS_CM_IF = 'org.fedorahosted.certmonger' DBUS_CM_NAME = 'org.fedorahosted.certmonger' DBUS_CM_REQUEST_IF = 'org.fedorahosted.certmonger.request' DBUS_CM_CA_IF = 'org.fedorahosted.certmonger.ca' DBUS_PROPERTY_IF = 'org.freedesktop.DBus.Properties' try: bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None) proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, DBUS_CM_NAME, DBUS_CM_PATH, DBUS_CM_IF, None) except GLib.Error as e: if e.code == Gio.DBusError.ACCESS_DENIED: print("access was denied") exit(1) try: res = proxy.call_sync('get_requests', None, Gio.DBusCallFlags.NO_AUTO_START, 500, None)[0] for req in res: print(f"Request {req}") req_proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, DBUS_CM_NAME, req, DBUS_CM_REQUEST_IF, None) req_res = req_proxy.get_cached_property_names() for prop in req_res: value = req_proxy.get_cached_property(prop) print(f"\t{prop}: {value}") except GLib.Error as e: print(e.message) if e.code == Gio.DBusError.ACCESS_DENIED: print("access was denied") exit(1)
Example test code: https://gitlab.gnome.org/GNOME/pygobject/blob/master/tests/test_gdbus.py One can also use help(proxy) and apply the same approach on other objects or use pydoc gi.repository.Gio to see whole generated documentation.
help(proxy)
pydoc gi.repository.Gio
Metadata Update from @abbra: - Issue set to the milestone: FreeIPA 4.9
I think that 500 should be replaced with -1 to use default timeout. An alternative approach is use of auto proxy, e.g. proxy.call_sync('get_requests', ...) can be replaced with proxy.get_requests().
-1
proxy.call_sync('get_requests', ...)
proxy.get_requests()
Metadata Update from @cheimes: - Issue set to the milestone: None (was: FreeIPA 4.9)
See also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/HCW37GQGWHJMND63KKZREHFX42HBO5OI/
dbus-python seem to be completely fine, this was most likely a false alarm.
Marking as closed, we'll stick with dbus-python.
Metadata Update from @rcritten: - Issue close_status updated to: wontfix - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.