Convert the network subfolder to py3/py2.4 syntax (#3690)

This commit is contained in:
Michael Scherer 2016-05-18 18:08:30 +02:00 committed by Matt Clay
parent 09066f1518
commit c0217e14a7
20 changed files with 90 additions and 47 deletions

View file

@ -102,7 +102,8 @@ changed:
def execute_config_command(commands, module):
try:
module.configure(commands)
except ShellError, clie:
except ShellError:
clie = get_exception()
module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands)
@ -134,7 +135,8 @@ def execute_show(cmds, module, command_type=None):
response = module.execute(cmds, command_type=command_type)
else:
response = module.execute(cmds)
except ShellError, clie:
except ShellError:
clie = get_exception()
module.fail_json(msg='Error sending {0}'.format(cmds),
error=str(clie))
return response
@ -523,4 +525,4 @@ from ansible.module_utils.shell import *
from ansible.module_utils.netcfg import *
from ansible.module_utils.nxos import *
if __name__ == '__main__':
main()
main()