[PATCH 4/4 master] Get rid of overrideDHCPHostname.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The way it works now, the attribute is not necessary. Note that
we keep setting DHCP_HOSTNAME (to make dhclient send host-name)
only for non-kickstart cases as before.
---
 pyanaconda/kickstart.py |    6 ++++--
 pyanaconda/network.py   |   12 +++---------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 0dfecd2..a038ba6 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -564,7 +564,6 @@ class NetworkData(commands.network.F16_NetworkData):
         if flags.imageInstall:
             if self.hostname != "":
                 self.anaconda.network.setHostname(self.hostname)
-                self.anaconda.network.overrideDHCPhostname = True
 
             # Only set hostname
             return
@@ -609,7 +608,6 @@ class NetworkData(commands.network.F16_NetworkData):
 
         if self.hostname != "":
             self.anaconda.network.setHostname(self.hostname)
-            self.anaconda.network.overrideDHCPhostname = True
             if not dev:
                 # Only set hostname
                 return
@@ -629,6 +627,10 @@ class NetworkData(commands.network.F16_NetworkData):
                 if (self.netmask):
                     dev.set(("NETMASK", self.netmask))
 
+            if self.bootProto == "dhcp" and self.hostname:
+                dev.set(("DHCP_HOSTNAME", self.hostname))
+
+
         # ipv6 settings
         if self.noipv6:
             dev.set(("IPV6INIT", "no"))
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 3b17a90..33fc68d 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -346,7 +346,6 @@ class Network:
     def __init__(self):
 
         self.hostname = socket.gethostname()
-        self.overrideDHCPhostname = False
 
         self.update()
         # We want wireless devices to be nm controlled by default
@@ -622,8 +621,9 @@ class Network:
                 line += " --essid %s" % dev.get("ESSID")
 
             # hostname
-            if (self.overrideDHCPhostname or
-                dev.get('BOOTPROTO').lower() != "dhcp"):
+            if dev.get("DHCP_HOSTNAME"):
+                line += " --hostname %s" % dev.get("DHCP_HOSTNAME")
+            elif dev.get("BOOTPROTO").lower != "dhcp":
                 if (self.hostname and
                     self.hostname != "localhost.localdomain"):
                     line += " --hostname %s" % self.hostname
@@ -746,12 +746,6 @@ class Network:
         # /etc/sysconfig/network-scripts/keys-*
         for dev in devices:
 
-            bootproto = dev.get('BOOTPROTO').lower()
-            # write out the hostname as DHCP_HOSTNAME if given (#81613)
-            if (bootproto == 'dhcp' and self.hostname and
-                self.overrideDHCPhostname):
-                dev.set(('DHCP_HOSTNAME', self.hostname))
-
             dev.writeIfcfgFile()
 
             if dev.wepkey:
-- 
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux