Fix if additional host is ""

This commit is contained in:
SebClem 2023-06-13 17:39:51 +02:00
parent d754a8f02a
commit 753e744d17
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -232,9 +232,10 @@ class ActionModule(ActionBase):
this_state = host.get('state', state)
if this_state == "present":
results['domain_maping'].append('{0}.{1} {2}'.format(host.get("hostname"), this_domain, backend.get("name")))
full_domain = '{0}.{1}'.format(host.get("hostname"), this_domain) if host.get("hostname") else this_domain
results['domain_maping'].append('{0} {2}'.format(full_domain, this_domain, backend.get("name")))
if this_protected:
results['protected_domain'].append('{0}.{1}'.format(host.get("hostname"), this_domain))
results['protected_domain'].append(full_domain)
if not this_dns.get("skip", dns.get("skip", False)):
if not this_dns_provider in results['dns_hostnames']: