warn only when zones were ignored

This commit is contained in:
Michael 2023-10-26 15:42:47 +02:00 committed by mib1185
parent 2c52f969e1
commit 42f7d48d73

View file

@ -356,8 +356,9 @@ def main():
specified_zones = module.params['zones']
collect_zones = list(set(specified_zones) & set(all_zones))
ignore_zones = list(set(specified_zones) - set(collect_zones))
warn.append(
'Please note: zone:(%s) have been ignored in the gathering process.' % ','.join(ignore_zones))
if ignore_zones:
warn.append(
'Please note: zone:(%s) have been ignored in the gathering process.' % ','.join(ignore_zones))
else:
collect_zones = get_all_zones(client)