mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-19 14:50:21 -07:00
Convert the network subfolder to py3/py2.4 syntax (#3690)
This commit is contained in:
parent
09066f1518
commit
c0217e14a7
20 changed files with 90 additions and 47 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue