def main():
    module = AnsibleModule(argument_spec=argument_spec)
    try:
        res = needs_restart(module.params)
    except CartridgeException as e:
        module.fail_json(msg=str(e))
    if (res.success is True):
        module.exit_json(changed=res.changed, meta=res.meta)
    else:
        module.fail_json(msg=res.msg)
def main():
    module = AnsibleModule(argument_spec=argument_spec)
    try:
        res = needs_restart(module.params)
    except CartridgeException as e:
        module.fail_json(msg=str(e))
    if (res.success is True):
        module.exit_json(changed=res.changed, meta=res.meta)
    else:
        module.fail_json(msg=res.msg)