Fix a couple undefined variables

One was a typo and one needed to have the variable defined in that scope
This commit is contained in:
Toshio Kuratomi 2016-10-12 13:26:54 -07:00 committed by Matt Clay
parent 79895061b4
commit badce91e80

View file

@ -104,11 +104,15 @@ EXAMPLES = '''
- firewalld: masquerade=yes state=enabled permanent=true zone=dmz - firewalld: masquerade=yes state=enabled permanent=true zone=dmz
''' '''
from ansible.module_utils.basic import AnsibleModule
fw = None fw = None
fw_offline = False fw_offline = False
Rich_Rule = None Rich_Rule = None
FirewallClientZoneSettings = None FirewallClientZoneSettings = None
module = None
##################### #####################
# fw_offline helpers # fw_offline helpers
# #
@ -362,6 +366,7 @@ def set_rich_rule_disabled_permanent(zone, rule):
def main(): def main():
global module
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(
@ -443,7 +448,7 @@ def main():
if module.params['interface'] != None and module.params['zone'] == None: if module.params['interface'] != None and module.params['zone'] == None:
module.fail(msg='zone is a required parameter') module.fail(msg='zone is a required parameter')
if module.params['immediate'] and fw_offiline: if module.params['immediate'] and fw_offline:
module.fail(msg='firewall is not currently running, unable to perform immediate actions without a running firewall daemon') module.fail(msg='firewall is not currently running, unable to perform immediate actions without a running firewall daemon')
## Global Vars ## Global Vars
@ -721,7 +726,5 @@ def main():
module.exit_json(changed=changed, msg=', '.join(msgs)) module.exit_json(changed=changed, msg=', '.join(msgs))
################################################# if __name__ == '__main__':
# import module snippets main()
from ansible.module_utils.basic import *
main()