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

[PATCH 03/15] Fix default hostname function to never return '(none)'.



---
 pyanaconda/network.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index f9d50cf..0a781c5 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -113,7 +113,7 @@ def getDefaultHostname(anaconda):
                     hn = hinfo[0]
                     break
 
-    if hn and hn != 'localhost' and hn != 'localhost.localdomain':
+    if hn and hn not in ('(none)', 'localhost', 'localhost.localdomain'):
         return hn
 
     try:
@@ -121,10 +121,10 @@ def getDefaultHostname(anaconda):
     except:
         hn = None
 
-    if not hn or hn == '(none)' or hn == 'localhost' or hn == 'localhost.localdomain':
+    if not hn or hn in ('(none)', 'localhost', 'localhost.localdomain'):
         hn = socket.gethostname()
 
-    if not hn or hn == '(none)' or hn == 'localhost':
+    if not hn or hn in ('(none)', 'localhost'):
         hn = 'localhost.localdomain'
 
     return hn
-- 
1.7.3.4


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