From f9383cb8ef810dae2ba2b1cef54e8880be5f52a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lichtblau?= Date: Wed, 21 Oct 2015 13:36:28 +0200 Subject: [PATCH] Check to make sure the firewalld client is connected before proceeding. Fixes #1138 Original patch referenced in https://github.com/ansible/ansible/issues/6911 ( https://github.com/ansible/ansible/commit/f547733b1f2136a531432ba652edebaec6873baf ) was undone by https://github.com/ansible/ansible-modules-extras/commit/6f2b61d2d88294ea7938020183ea613b7e5e878d --- lib/ansible/modules/extras/system/firewalld.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/firewalld.py b/lib/ansible/modules/extras/system/firewalld.py index 0da738f01c8..89fc0599e8a 100644 --- a/lib/ansible/modules/extras/system/firewalld.py +++ b/lib/ansible/modules/extras/system/firewalld.py @@ -98,7 +98,10 @@ try: from firewall.client import Rich_Rule from firewall.client import FirewallClient fw = FirewallClient() - HAS_FIREWALLD = True + if not fw.connected: + HAS_FIREWALLD = False + else: + HAS_FIREWALLD = True except ImportError: HAS_FIREWALLD = False