[lnst] NetConfig: Adding device rescan to add methods

Jiří Pírko jirka at fedoraproject.org
Mon Aug 13 11:37:46 UTC 2012


commit b14157984d8e33cd10408c87c2df18778f559621
Author: Radek Pazdera <rpazdera at redhat.com>
Date:   Mon Aug 13 12:01:49 2012 +0200

    NetConfig: Adding device rescan to add methods
    
    Now, when devices can be added dynamically to the slaves, NetConfig
    is obligated to rescan the existing devices each time a new device
    is configured.
    
    Signed-off-by: Radek Pazdera <rpazdera at redhat.com>

 NetConfig/NetConfig.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index 41a99d8..75d5129 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -65,6 +65,8 @@ class NetConfig:
             NetConfigDeviceType(dev_type).type_init()
 
         self._config[if_id] = config
+
+        self._devnames.rescan_netdevs()
         self._devnames.assign_name(if_id, self._config)
 
     def remove_interface_config(self, if_id):
@@ -125,6 +127,8 @@ class NetConfig:
             if "slaves" in params:
                 netdev["slaves"] = params["slaves"]
         self._config[dev_id] = netdev
+
+        self._devnames.rescan_netdevs()
         self._devnames.assign_name(dev_id, self._config)
         return dev_id
 


More information about the LNST-developers mailing list