2 Commits
Author SHA1 Message Date
36d9bc2ebc firewalld_info: fail cleanly when D-Bus is unavailable (#805) (#808)
python-firewall wraps a missing D-Bus socket in FirewallError, which the module did not catch, so Ansible reported a module crash instead of a normal failure.

Fixes #678


Assisted-by: Grok 4.7

Signed-off-by: Nikhil Jain <nikhjain@redhat.com>
Co-authored-by: Nikhil Jain <101691834+nikhjain14@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-21 10:26:31 +09:00
Hideki SaitoandGitHub 7f65f3e6d5 Update AZP remote tests (#809) (#810)
* Removing FreeBSD 13.5.
* Pinning RHEL 9.8 to Python 3.9 to keep compatibility with Python firewall library.

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-10-21 09:21:07 +09:00
4 changed files with 15 additions and 11 deletions
+2 -11
View File
@@ -273,8 +273,8 @@ stages:
targets:
- name: RHEL 10.2
test: rhel/10.2
- name: RHEL 9.8
test: rhel/9.8
- name: RHEL 9.8 py39
test: rhel/9.8@3.9
- name: FreeBSD 14.5
test: freebsd/14.5
- name: FreeBSD 15.1
@@ -311,8 +311,6 @@ stages:
test: rhel/9.7
- name: FreeBSD 14.3
test: freebsd/14.3
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_19
displayName: Remote 2.19
@@ -328,8 +326,6 @@ stages:
test: rhel/9.7
- name: FreeBSD 14.3
test: freebsd/14.3
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_18
displayName: Remote 2.18
@@ -343,8 +339,6 @@ stages:
test: rhel/10.1
- name: RHEL 9.7
test: rhel/9.7
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_17
displayName: Remote 2.17
@@ -357,9 +351,6 @@ stages:
targets:
- name: RHEL 10.0
test: rhel/10.0
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_16
displayName: Remote 2.16
dependsOn: []
@@ -0,0 +1,4 @@
bugfixes:
- firewalld_info - return a module failure instead of a traceback when python-firewall raises
``FirewallError``, for example when D-Bus is unavailable
(https://github.com/ansible-collections/ansible.posix/issues/678).
@@ -0,0 +1,5 @@
---
trivial:
- CI - remove FreeBSD version 13.5 from AZP remote tests.
- CI - use Python 3.9 on RHEL 9.8 in AZP remote devel to keep compatibility with Python firewall library.
...
+4
View File
@@ -224,9 +224,11 @@ except ImportError:
try:
import firewall.client as fw_client
import firewall.config as fw_config
import firewall.errors as fw_errors
HAS_FIREWALLD = True
except ImportError:
HAS_FIREWALLD = False
fw_errors = None
def get_version():
@@ -387,6 +389,8 @@ def main():
module.fail_json(msg=('Unable to gather firewalld settings.'
' You may need to run as the root user or'
' use become. (Error: %s)' % to_native(e)))
except fw_errors.FirewallError as e:
module.fail_json(msg='Unable to gather firewalld settings. (Error: %s)' % to_native(e))
result['collected_zones'] = collect_zones
result['undefined_zones'] = ignore_zones