Fix full_domain if state != present

This commit is contained in:
SebClem 2024-03-29 16:20:01 +01:00
parent a6c381772c
commit 188a850035
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -249,9 +249,10 @@ class ActionModule(ActionBase):
this_protected = host.get('protected', protected)
this_state = host.get('state', state)
this_uptime_raw_config = host.get("uptime", dict())
full_domain = '{0}.{1}'.format(host.get("hostname"), this_domain) if host.get("hostname") else this_domain
if this_state == "present":
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(full_domain)