[master 7/20] libnm in spoke: delete connection using libnm client

rvykydal installerbot-noreply at redhat.com
Mon Aug 31 14:55:50 UTC 2015


From: Radek Vykydal <rvykydal at redhat.com>

---
 pyanaconda/nm.py                    | 15 ---------------
 pyanaconda/ui/gui/spokes/network.py |  2 +-
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py
index 201c544..c27730f 100644
--- a/pyanaconda/nm.py
+++ b/pyanaconda/nm.py
@@ -891,21 +891,6 @@ def nm_add_connection(values):
         raise
     return connection
 
-def nm_delete_connection(uuid):
-    """Delete connection specified by uuid.
-
-       :param uuid: uuid of connection to be deleted
-       :type uuid: str
-       :return: True if connection was deleted, False if it was not found
-       :rtype: bool
-    """
-
-    settings_paths = _find_settings(uuid, "connection", "uuid")
-    if not settings_paths:
-        return False
-    proxy = _get_proxy(object_path=settings_paths[0], interface_name="org.freedesktop.NetworkManager.Settings.Connection")
-    proxy.Delete()
-
 def nm_update_settings_of_device(name, new_values):
     """Update setting of device.
 
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index a60be29..7f7513b 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -652,7 +652,7 @@ def on_remove_device_clicked(self, *args):
             return None
         dev_cfg = model[itr][DEVICES_COLUMN_OBJECT]
         model.remove(itr)
-        nm.nm_delete_connection(dev_cfg.con_uuid)
+        self.client.get_connection_by_uuid(dev_cfg.con_uuid).delete()
 
     def add_device(self, ty):
         log.info("network: adding device of type %s", ty)


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/e1f0caeddee728d9efb1015c995ea90141a812ea


More information about the anaconda-patches mailing list