From c4c7e43020d6386991bd79b14e09385af73740b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Lichtblau?= <b.lichtblau@fu-berlin.de>
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
---
 system/firewalld.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/system/firewalld.py b/system/firewalld.py
index 47d98544000..61e4a546132 100644
--- a/system/firewalld.py
+++ b/system/firewalld.py
@@ -97,7 +97,10 @@ try:
 
     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