diff options
author | Mike Fulbright <msf@redhat.com> | 2002-06-21 05:38:57 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-06-21 05:38:57 +0000 |
commit | a642f44e66d3675d42f470d0b8c4eae7898fd161 (patch) | |
tree | 2f869eb8546c24314aef32976653663753fac729 /network.py | |
parent | b208af8570262aff1d2361e9b7f36655c515c767 (diff) | |
download | anaconda-a642f44e66d3675d42f470d0b8c4eae7898fd161.tar.gz anaconda-a642f44e66d3675d42f470d0b8c4eae7898fd161.tar.xz anaconda-a642f44e66d3675d42f470d0b8c4eae7898fd161.zip |
fix writing out ks stanza
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/network.py b/network.py index d47a54648..f1f66b505 100644 --- a/network.py +++ b/network.py @@ -224,17 +224,23 @@ class Network: f.write("network --device %s" % dev.get('device')) if dev.get('bootproto') == 'dhcp': f.write(" --bootproto dhcp") + if self.overrideDHCPhostname: + if (self.hostname and + self.hostname != "localhost.localdomain"): + f.write(" --hostname %s" % self.hostname) else: - f.write(" --bootproto static --ip %s --netmask %s --gateway %s" % - (dev.get('ipaddr'), dev.get('netmask'), self.gateway)) + f.write(" --bootproto static --ip %s --netmask %s" % + (dev.get('ipaddr'), dev.get('netmask'))) - if dev.get('bootproto') != 'dhcp': - if self.primaryNS: + if self.gateway is not None: + f.write(" --gateway %s" % (self.gateway,)) + + if self.primaryNS: f.write(" --nameserver %s" % self.primaryNS) - if (self.hostname and - self.hostname != "localhost.localdomain"): - f.write(" --hostname %s" % self.hostname) + if (self.hostname and + self.hostname != "localhost.localdomain"): + f.write(" --hostname %s" % self.hostname) f.write("\n"); |