From a579a34f6111f9c3b63637a4633e236395caf49a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 7 Apr 2012 11:47:07 +0200 Subject: [PATCH] Add domain part to hostname if it has not got one. --- python/pakfire/system.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- 2.39.5