From: Michael Tremer Date: Sat, 7 Apr 2012 09:47:07 +0000 (+0200) Subject: Add domain part to hostname if it has not got one. X-Git-Tag: 0.9.22~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a579a34f6111f9c3b63637a4633e236395caf49a;p=pakfire.git Add domain part to hostname if it has not got one. --- diff --git a/python/pakfire/system.py b/python/pakfire/system.py index 36d5da459..70f9cd156 100644 --- a/python/pakfire/system.py +++ b/python/pakfire/system.py @@ -34,7 +34,13 @@ class System(object): """ @property def hostname(self): - return socket.gethostname() + hn = socket.gethostname() + + # If a host has got no domain part, we add one. + if not "." in hn: + hn = "%s.localdomain" % hn + + return hn @property def native_arch(self):