From e7b3db898270e6a6a252eee7697302fb0c1f7d38 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 19 Mar 2007 18:56:16 +0000 Subject: plugins are now able to add device specific text to /etc/networking/interfaces example: where = PluginDescriptor.WHERE_NETWORKSETUP, fnc={"ifaceSupported": callFunction, "configStrings": configStrings} with def PluginFunction(session, iface): session.open(, iface) def callFunction(iface): if : return PluginFunction else: return None def configSrings(iface): return "# would add this to adapter iface into /etc/networking/interfaces" --- lib/python/Components/Network.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/python/Components/Network.py') diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 884f97cd..37af0c98 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -113,6 +113,9 @@ class Network: fp.write(" netmask %d.%d.%d.%d\n" % tuple(iface['netmask'])) if iface.has_key('gateway'): fp.write(" gateway %d.%d.%d.%d\n" % tuple(iface['gateway'])) + + if iface.has_key("configStrings"): + fp.write("\n" + iface["configStrings"] + "\n") fp.write("\n") fp.close() self.writeNameserverConfig() @@ -211,6 +214,7 @@ class Network: return None def setAdapterAttribute(self, iface, attribute, value): + print "setting for adapter", iface, "attribute", attribute, " to value", value if self.ifaces.has_key(iface): self.ifaces[iface][attribute] = value -- cgit v1.2.3