[Python-modules-team] Bug#934743: python-networkmanager: org.freedesktop.DBus.Error.ServiceUnknown if NetworkManager service restarts

Ana Rodriguez Lopez rodrilopez.ana at gmail.com
Wed Aug 14 10:19:31 BST 2019


Package: python3-networkmanager
Version: 2.1-2
Tags: patch
Forwarded: https://github.com/seveas/python-networkmanager/issues/66

If NetworkManager service restarts, it gets a new dbus unix process id.
The python-networkmanager remains with the old id. since this process
doesn't exist any more, a org.freedesktop.DBus.Error.ServiceUnknown
exception is thrown.

The parameter follow_name_owner_changes can be used in get_object()
calls to prevent this.

diff --git a/NetworkManager.py b/NetworkManager.py
index 3d137fe..00f0729 100644
--- a/NetworkManager.py
+++ b/NetworkManager.py
@@ -258,7 +258,7 @@ def __eq__(self, other):
     @property
     def proxy(self):
         if not self._proxy:
-            self._proxy =
dbus.SystemBus().get_object(self.dbus_service, self.object_path)
+            self._proxy =
dbus.SystemBus().get_object(self.dbus_service, self.object_path,
follow_name_owner_changes=True)
             self._proxy.created = time.time()
         elif self._proxy.created < self.last_disconnect:
             if self.is_transient:


https://github.com/anrodlo/python-networkmanager/commit/88f1b0e4531f80e17af3ffe00b5816800ebb4c1a.diff



More information about the Python-modules-team mailing list