dont start self.console twice
authoracid-burn <acidburn@opendreambox.org>
Fri, 14 Nov 2008 11:26:44 +0000 (12:26 +0100)
committeracid-burn <acidburn@opendreambox.org>
Fri, 14 Nov 2008 11:26:44 +0000 (12:26 +0100)
lib/python/Components/Network.py

index 53b487d512e464fdff971e039cf638e93b8bacf6..f32a648c05d0737f333d8fed9f400f7796cfedbc 100755 (executable)
@@ -63,7 +63,8 @@ class Network:
 
        def getDataForInterface(self, iface,callback):
                #get ip out of ip addr, as avahi sometimes overrides it in ifconfig.
-               self.Console = Console()
+               if not self.Console:
+                       self.Console = Console()
                cmd = "ip -o addr"
                self.Console.ePopen(cmd, self.IPaddrFinished, [iface,callback])
 
@@ -213,15 +214,16 @@ class Network:
                for ifacename, iface in ifaces.items():
                        if self.ifaces.has_key(ifacename):
                                self.ifaces[ifacename]["dhcp"] = iface["dhcp"]
-               if len(self.Console.appContainers) == 0:
-                       # save configured interfacelist
-                       self.configuredNetworkAdapters = self.configuredInterfaces
-                       # load ns only once     
-                       self.loadNameserverConfig()
-                       print "read configured interfac:", ifaces
-                       print "self.ifaces after loading:", self.ifaces
-                       if callback is not None:
-                               callback(True)
+               if self.Console:
+                       if len(self.Console.appContainers) == 0:
+                               # save configured interfacelist
+                               self.configuredNetworkAdapters = self.configuredInterfaces
+                               # load ns only once     
+                               self.loadNameserverConfig()
+                               print "read configured interfac:", ifaces
+                               print "self.ifaces after loading:", self.ifaces
+                               if callback is not None:
+                                       callback(True)
 
        def loadNameserverConfig(self):
                ipRegexp = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"