diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-05-05 16:38:07 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-05-06 08:30:44 -1000 |
commit | 5ebb7235d36390fa72faa730c1f5a452e3432eb1 (patch) | |
tree | c12d47b977e953962f10e1d0bcee5b15d4956824 /network.py | |
parent | 0dbbbc01d5d3c9e21715fbb1af042a3957b62fe9 (diff) | |
download | anaconda-5ebb7235d36390fa72faa730c1f5a452e3432eb1.tar.gz anaconda-5ebb7235d36390fa72faa730c1f5a452e3432eb1.tar.xz anaconda-5ebb7235d36390fa72faa730c1f5a452e3432eb1.zip |
Write out correct hostname during LiveCD installs (#492515)
If doing a LiveCD install, make sure we write out HOSTNAME= in
/etc/sysconfig/network and set it to the value entered in anaconda
rather than localhost.localdomain.
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/network.py b/network.py index 087f8c57a..e3ce2c169 100644 --- a/network.py +++ b/network.py @@ -1,7 +1,8 @@ # # network.py - network configuration install data # -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. +# 2008, 2009 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -624,7 +625,7 @@ class Network: log.warning("unable to copy %s to target system" % (dhclientconf,)) # /etc/sysconfig/network - if (not instPath) or (not os.path.isfile(destnetwork)): + if (not instPath) or (not os.path.isfile(destnetwork)) or flags.livecdInstall: newnetwork = "%s.new" % (destnetwork,) f = open(newnetwork, "w") @@ -671,7 +672,7 @@ class Network: self.domains = [domainname] # /etc/resolv.conf - if (not instPath) or (not os.path.isfile(instPath + '/etc/resolv.conf')): + if (not instPath) or (not os.path.isfile(instPath + '/etc/resolv.conf')) or flags.livecdInstall: if os.path.isfile('/etc/resolv.conf') and instPath != '': destresolv = "%s/etc/resolv.conf" % (instPath,) shutil.copy('/etc/resolv.conf', destresolv) @@ -692,7 +693,7 @@ class Network: # /etc/udev/rules.d/70-persistent-net.rules rules = instPath + "/etc/udev/rules.d/70-persistent-net.rules" - if (not instPath) or (not os.path.isfile(rules)): + if (not instPath) or (not os.path.isfile(rules)) or flags.livecdInstall: if not os.path.isdir("%s/etc/udev/rules.d" %(instPath,)): iutil.mkdirChain("%s/etc/udev/rules.d" %(instPath,)) |