From 2fb551131e90f3d62051f490cc187c99ec767ba7 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 17 Aug 2016 20:27:51 +0200 Subject: [PATCH] Fix error when non-existing host is used. --- cdist/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index 9d4c5c10..a873089d 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -244,16 +244,16 @@ class Config(object): # (hostname, aliaslist, ipaddrlist) host_name = socket.gethostbyaddr(ip_addr)[0] except socket.gaierror as e: - log.error("{}: {}".format(e[0], e[1])) + log.warn("{}".format(e)) # in case of error provide empty value - host_name = None + host_name = '' try: host_fqdn = socket.getfqdn(host) except socket.herror as e: - log.error("{}: {}".format(e[0], e[1])) + log.warn("{}: {}".format(e[0], e[1])) # in case of error provide empty value - host_fqdn = None + host_fqdn = '' target_host = (host, host_name, host_fqdn) local = cdist.exec.local.Local(