diff options
| author | Radek Vykydal <rvykydal@redhat.com> | 2012-08-23 15:22:11 +0200 |
|---|---|---|
| committer | Radek Vykydal <rvykydal@redhat.com> | 2012-08-27 15:50:37 +0200 |
| commit | 2fe596d394981d638846aaad00fff27518db00cb (patch) | |
| tree | 10822c9e9c4302474b75424cfb650f2412966ee8 /pyanaconda | |
| parent | 32e65bbc8c29a24863594cf9ecd11449c7b505d8 (diff) | |
| download | anaconda-2fe596d394981d638846aaad00fff27518db00cb.tar.gz anaconda-2fe596d394981d638846aaad00fff27518db00cb.tar.xz anaconda-2fe596d394981d638846aaad00fff27518db00cb.zip | |
networking: use ksdata.network.hostname instead of actual installer hostname
ksdata.network.hostname which is new property (there is a related kickstart
patch) obtaining the hostname from network commands (ksdata.network.network
list of NetworkData objects). The goal is to use this data instead
of getting actual hostname of installer (getHostname function)
notes:
- ksdata.network.hostname value will be initalized in networkInitialize
(following patch)
- getHostname (actual hostname of system) is still used in dracutSetupArgs,
we need to get ksdata passed somehow from bootloader.py:set_boot_args()
- Hostname of installer environment is still set in kickstart. We used to
do it because of mdadm member naming (640743) but this is not needed
anymore - mdadm actually doesn't use it. If it starts to again, or
does it in some special conditions, we can pass ksdata.network.hostname
(as we do for default vg names) using --homehost option.
We might need to set the hostname for some installed package though,
so I am keeping it.
- We should think about where to set hostname in GUI. This should happen
before writing storage (needed for vg, mdmember names), or we can drop
default naming based on hostname.
Diffstat (limited to 'pyanaconda')
| -rw-r--r-- | pyanaconda/network.py | 6 | ||||
| -rw-r--r-- | pyanaconda/storage/__init__.py | 14 |
2 files changed, 5 insertions, 15 deletions
diff --git a/pyanaconda/network.py b/pyanaconda/network.py index 111835758..e5c4a881f 100644 --- a/pyanaconda/network.py +++ b/pyanaconda/network.py @@ -773,11 +773,7 @@ def write_sysconfig_network(rootpath, ksdata, overwrite=False): f.write("NETWORKING=yes\n") f.write("HOSTNAME=") - hostname = getHostname() - if hostname: - f.write(hostname + "\n") - else: - f.write("localhost.localdomain\n") + f.write("HOSTNAME=%s\n" % ksdata.network.hostname) gateway = ipv6_defaultgw = None for iface in reversed(getDevices()): diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 973b9f2c6..1281145c7 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -1117,11 +1117,8 @@ class Storage(object): name = kwargs.pop("name") else: hostname = "" - if self.data: - for nd in self.data.network.dataList(): - if nd.hostname: - hostname = nd.hostname - break + if self.data and self.data.network.hostname is not None: + hostname = self.data.network.hostname name = self.suggestContainerName(hostname=hostname) @@ -1189,11 +1186,8 @@ class Storage(object): # set up the volume label, using hostname if necessary if not name: hostname = "" - if self.data: - for nd in self.data.network.dataList(): - if nd.hostname: - hostname = nd.hostname - break + if self.data and self.data.network.hostname is not None: + hostname = self.data.network.hostname name = self.suggestContainerName(hostname=hostname) if "label" not in fmt_args: |
