From 104d753730c70788cd65d1c3a2fd81ab08cea3a8 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Wed, 3 Aug 2016 18:04:51 -0400 Subject: [PATCH] Quick fix to nxos_command and minify imports --- network/nxos/nxos_command.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/network/nxos/nxos_command.py b/network/nxos/nxos_command.py index 0e6e3b6f09c..9ad82f71c04 100644 --- a/network/nxos/nxos_command.py +++ b/network/nxos/nxos_command.py @@ -115,9 +115,14 @@ failed_conditions: """ import time -import shlex import re +from ansible.module_utils.basic import get_exception +from ansible.module_utils.netcmd import Conditional +from ansible.module_utils.network import get_module +from ansible.module_utils.nxos import * + + INDEX_RE = re.compile(r'(\[\d+\])') def iterlines(stdout): @@ -158,7 +163,7 @@ def main(): kwargs['command_type'] = 'cli_show' while retries > 0: - response = module.execute(commands, **kwargs) + response = module.cli(commands, **kwargs) result['stdout'] = response for index, cmd in enumerate(commands): @@ -188,11 +193,5 @@ def main(): return module.exit_json(**result) -from ansible.module_utils.basic import * -from ansible.module_utils.urls import * -from ansible.module_utils.shell import * -from ansible.module_utils.netcfg import * -from ansible.module_utils.nxos import * if __name__ == '__main__': - main() - + main()