diff options
-rw-r--r-- | network.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/network.py b/network.py index adde7cbcd..a2624cf76 100644 --- a/network.py +++ b/network.py @@ -677,14 +677,9 @@ class Network: domainname = None localline = "localhost.localdomain localhost" - if not ip or not fqdn: - # There is no ip or no fqdn, tie it to 127.0.0.1. - if fqdn: - # add fqdn to 127.0.0.1 - localline += " " + fqdn - if hostname and hostname != "localhost": - # add short hostname to 127.0.0.1 - localline += " " + hostname + if not ip and (hostname and hostname != "localhost"): + # add short hostname to 127.0.0.1 + localline += " " + hostname f.write("# Do not remove the following line, or various programs\n") f.write("# that require network functionality will fail.\n") |