Warn only when zones were ignored in firewalld_info (#504)

* warn only when zones were ignored

* add changelog 504-firewalld_info-warning
This commit is contained in:
Michael
2024-01-09 23:07:58 +01:00
committed by GitHub
parent 2a1fb334ee
commit 0847977d12
2 changed files with 5 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
minor_changes:
- firewalld_info - Only warn about ignored zones, when there are zones ignored.

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)