From 4690ebce3b552f8c5fd45cd3ad773444d7355038 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Mon, 27 Oct 2008 09:21:56 +0000 Subject: [PATCH] changes on behalf of acid-burn --- lib/python/Components/Network.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index c28710b7..56506a50 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -88,9 +88,9 @@ class Network: data['mac'] = mac if not data.has_key('ip'): data['dhcp'] = True - data['ip'] = [192, 168, 1, 2] - data['netmask'] = [255, 255, 255, 0] - data['gateway'] = [192, 168, 1, 1] + data['ip'] = [0, 0, 0, 0] + data['netmask'] = [0, 0, 0, 0] + data['gateway'] = [0, 0, 0, 0] fp = popen("route -n | grep " + iface) result = fp.readlines() @@ -177,9 +177,11 @@ class Network: if self.ifaces[currif]["gateway"] != ifaces[currif]["gateway"] and ifaces[currif]["dhcp"] == False: self.ifaces[currif]["gateway"] = map(int, split[1].split('.')) if (split[0] == "pre-up"): - self.ifaces[currif]["preup"] = i + if self.ifaces[currif].has_key("preup"): + self.ifaces[currif]["preup"] = i if (split[0] == "post-down"): - self.ifaces[currif]["postdown"] = i + if self.ifaces[currif].has_key("postdown"): + self.ifaces[currif]["postdown"] = i print "read interfaces:", ifaces for ifacename, iface in ifaces.items(): @@ -332,6 +334,12 @@ class Network: self.container.appClosed.get().remove(self.cmdFinished) self.container.dataAvail.get().remove(self.dataAvail) + def stopContainer(self): + self.container.kill() + + def ContainerRunning(self): + return self.container.running() + def checkforInterface(self,iface): if self.getAdapterAttribute(iface, 'up') is True: return True -- 2.30.2