mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Check to make sure the firewalld client is connected before proceeding
Fixes #6911
This commit is contained in:
parent
d240d073eb
commit
f547733b1f
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
||||
################
|
||||
|
|
Loading…
Reference in a new issue