Use argument type checking to convert to boolean

This commit is contained in:
Daniel Hokka Zakrisson
2013-02-23 19:59:52 +01:00
parent 9076f8eb31
commit df798d0688
22 changed files with 77 additions and 77 deletions

View File

@@ -158,8 +158,8 @@ def main():
module = AnsibleModule(
argument_spec = dict(
name=dict(required=True),
persistent=dict(default='no', choices=BOOLEANS),
state=dict(required=True, choices=BOOLEANS)
persistent=dict(default='no', choices=BOOLEANS, type='bool'),
state=dict(required=True, choices=BOOLEANS, type='bool')
)
)
@@ -173,8 +173,8 @@ def main():
module.fail_json(msg="SELinux is disabled on this host.")
name = module.params['name']
persistent = module.boolean(module.params['persistent'])
state = module.boolean(module.params['state'])
persistent = module.params['persistent']
state = module.params['state']
result = {}
result['name'] = name