From f547733b1f2136a531432ba652edebaec6873baf Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 15 Apr 2014 15:03:52 -0500 Subject: [PATCH] Check to make sure the firewalld client is connected before proceeding Fixes #6911 --- library/system/firewalld | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/system/firewalld b/library/system/firewalld index 62c90d0656c..22db165aad3 100644 --- a/library/system/firewalld +++ b/library/system/firewalld @@ -85,8 +85,13 @@ try: from firewall.client import FirewallClient fw = FirewallClient() + if not fw.connected: + raise Exception('failed to connect to the firewalld daemon') except ImportError: - print "fail=True msg='firewalld required for this module'" + print "failed=True msg='firewalld required for this module'" + sys.exit(1) +except Exception, e: + print "failed=True msg='%s'" % str(e) sys.exit(1) ################