Check to make sure the firewalld client is connected before proceeding

Fixes #6911
This commit is contained in:
James Cammarata 2014-04-15 15:03:52 -05:00
parent 556c780ac9
commit 0c96e2f33b

View file

@ -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)
################