Refactor nxos_reboot module (#24484)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
fd1debb869
commit
3d51081a59
2 changed files with 5 additions and 12 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue