Commit 4220c3cc by Adam Miller

added try/catch around .connected call

parent 50adda50
...@@ -194,8 +194,12 @@ def main(): ...@@ -194,8 +194,12 @@ def main():
timeout = module.params['timeout'] timeout = module.params['timeout']
## Check for firewalld running ## Check for firewalld running
if fw.connected == False: try:
module.fail_json(msg='firewalld service must be running') if fw.connected == False:
module.fail_json(msg='firewalld service must be running')
except AttributeError:
module.fail_json(msg="firewalld connection can't be established,\
version likely too old. Requires firewalld >= 2.0.11")
if service != None and port != None: if service != None and port != None:
module.fail_json(msg='can only operate on port or service at once') module.fail_json(msg='can only operate on port or service at once')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment