Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Build System (http://www.linux-archive.org/fedora-build-system/)
-   -   Fix default hostname function to never return '(none)'. (http://www.linux-archive.org/fedora-build-system/609916-fix-default-hostname-function-never-return-none.html)

David Lehman 12-13-2011 09:58 PM

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

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


All times are GMT. The time now is 01:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.