diff --git a/lib/ansible/modules/network/nxos/nxos_reboot.py b/lib/ansible/modules/network/nxos/nxos_reboot.py index baaee89fe2..338c8a0429 100644 --- a/lib/ansible/modules/network/nxos/nxos_reboot.py +++ b/lib/ansible/modules/network/nxos/nxos_reboot.py @@ -59,7 +59,7 @@ rebooted: sample: true ''' -from ansible.module_utils.nxos import get_config, load_config, run_commands +from ansible.module_utils.nxos import run_commands from ansible.module_utils.nxos import nxos_argument_spec, check_args from ansible.module_utils.basic import AnsibleModule @@ -71,28 +71,22 @@ def reboot(module): ] run_commands(module, cmds) + def main(): argument_spec = {} argument_spec.update(nxos_argument_spec) - module = AnsibleModule(argument_spec=argument_spec, - supports_check_mode=True) + module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) warnings = list() check_args(module, warnings) + results = dict(changed=False, warnings=warnings) if not module.check_mode: reboot(module) - changed = True - - results = { - 'changed': True, - 'warnings': warnings - } + results['changed'] = True module.exit_json(**results) - if __name__ == '__main__': main() - diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index bfc3b3e86f..660a0b2812 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -518,7 +518,6 @@ lib/ansible/modules/network/nxos/nxos_pim_interface.py lib/ansible/modules/network/nxos/nxos_pim_rp_address.py lib/ansible/modules/network/nxos/nxos_ping.py lib/ansible/modules/network/nxos/nxos_portchannel.py -lib/ansible/modules/network/nxos/nxos_reboot.py lib/ansible/modules/network/nxos/nxos_smu.py lib/ansible/modules/network/nxos/nxos_snapshot.py lib/ansible/modules/network/nxos/nxos_snmp_community.py