added try/catch around .connected call

reviewable/pr18780/r1
Adam Miller 11 years ago
parent b1583d61c2
commit 36531cf394

@ -194,8 +194,12 @@ def main():
timeout = module.params['timeout']
## Check for firewalld running
try:
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:
module.fail_json(msg='can only operate on port or service at once')

Loading…
Cancel
Save