summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-08-04 20:21:15 +0200
committerHans de Goede <hdegoede@redhat.com>2009-08-05 11:36:41 +0200
commit56a1617bccf7680ebb36e460e6ff8c3b49f5982a (patch)
treefc6cdf2fd3bbb4079f1ce36051dbb2b39209e147
parente92b8d668a6e3ab5d64de83ba12648b8205d82e5 (diff)
downloadanaconda-56a1617bccf7680ebb36e460e6ff8c3b49f5982a.tar.gz
anaconda-56a1617bccf7680ebb36e460e6ff8c3b49f5982a.tar.xz
anaconda-56a1617bccf7680ebb36e460e6ff8c3b49f5982a.zip
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.
-rw-r--r--network.py10
1 files 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])