firewalld: remove BabyJSON
See https://github.com/ansible/ansible-modules-extras/issues/430
This commit is contained in:
parent
22f1cbd21f
commit
db3e4c8c65
1 changed files with 7 additions and 12 deletions
|
@ -67,8 +67,8 @@ options:
|
|||
required: false
|
||||
default: 0
|
||||
notes:
|
||||
- Not tested on any debian based system.
|
||||
requirements: [ firewalld >= 0.2.11 ]
|
||||
- Not tested on any Debian based system.
|
||||
requirements: [ 'firewalld >= 0.2.11' ]
|
||||
author: '"Adam Miller (@maxamillion)" <maxamillion@fedoraproject.org>'
|
||||
'''
|
||||
|
||||
|
@ -82,7 +82,6 @@ EXAMPLES = '''
|
|||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
try:
|
||||
import firewall.config
|
||||
|
@ -90,14 +89,9 @@ try:
|
|||
|
||||
from firewall.client import FirewallClient
|
||||
fw = FirewallClient()
|
||||
if not fw.connected:
|
||||
raise Exception('failed to connect to the firewalld daemon')
|
||||
HAS_FIREWALLD = True
|
||||
except ImportError:
|
||||
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)
|
||||
HAS_FIREWALLD = False
|
||||
|
||||
################
|
||||
# port handling
|
||||
|
@ -223,6 +217,9 @@ def main():
|
|||
supports_check_mode=True
|
||||
)
|
||||
|
||||
if not HAS_FIREWALLD:
|
||||
module.fail_json(msg='firewalld required for this module')
|
||||
|
||||
## Pre-run version checking
|
||||
if FW_VERSION < "0.2.11":
|
||||
module.fail_json(msg='unsupported version of firewalld, requires >= 2.0.11')
|
||||
|
@ -400,6 +397,4 @@ def main():
|
|||
#################################################
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
main()
|
||||
|
||||
|
|
Loading…
Reference in a new issue