Fix "label empty or too long" error #645

This commit is contained in:
Darko Poljak 2018-03-09 09:58:49 +01:00
parent bfe8b8fa57
commit b0c5bc793d
2 changed files with 11 additions and 1 deletions

View File

@ -333,6 +333,15 @@ class Config(object):
family = 0
return family
@staticmethod
def resolve_target_addresses(host, family):
try:
return ipaddr.resolve_target_addresses(host, family)
except:
e = sys.exc_info()[1]
raise cdist.Error(("Error resolving target addresses for host '{}'"
": {}").format(host, e))
@classmethod
def onehost(cls, host, host_tags, host_base_path, host_dir_name, args,
parallel, configuration, remove_remote_files_dirs=False):
@ -353,7 +362,7 @@ class Config(object):
family = cls._address_family(args)
log.debug("address family: {}".format(family))
target_host = ipaddr.resolve_target_addresses(host, family)
target_host = cls.resolve_target_addresses(host, family)
log.debug("target_host for host \"{}\": {}".format(
host, target_host))

View File

@ -16,6 +16,7 @@ next:
* New type: __apt_default_release (Matthijs Kooijman)
* Type __file: Add pre-exists state (Matthijs Kooijman)
* Type __grafana_dashboard: Add support for stretch + ascii (Nico Schottelius)
* Core: Fix idna (getaddrinfo) unicode tracebak for invalid host name (Darko Poljak)
4.8.0: 2018-02-14
* Core: Skip empty lines in parameter files (Darko Poljak)