From 56a1617bccf7680ebb36e460e6ff8c3b49f5982a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 4 Aug 2009 20:21:15 +0200 Subject: Fix backtrace in network.dracutSetupString in the static ip case NetworkDevice.get() only takes one argument, iow its not like the standard get on a dictionary. This patch fixes the assumption that it is thereby fixing a backtrace when using static ip configuration. --- network.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/network.py b/network.py index db1fab1e3..2d727b909 100644 --- a/network.py +++ b/network.py @@ -805,11 +805,15 @@ class Network: if dev.get('bootproto').lower() == 'dhcp': return "ip=%s:dhcp" % routeInfo[2] + if dev.get('GATEWAY'): + gateway = dev.get('GATEWAY') + else: + gateway = "" + if self.hostname: hostname = self.hostname else: hostname = "" - ip = "ip=%s::%s:%s:%s:none" % (dev.get('ipaddr'), - dev.get('GATEWAY', ''), dev.get('netmask'), hostname, - routeInfo[2]) + return "ip=%s::%s:%s:%s:%s:none" % (dev.get('ipaddr'), gateway, + dev.get('netmask'), hostname, routeInfo[2]) -- cgit