mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-17 22:01:07 -07:00
Check for ConnectionError on change of config or commands (#41504)
This commit is contained in:
parent
5814b90835
commit
50e776877d
5 changed files with 45 additions and 14 deletions
|
@ -147,7 +147,11 @@ class Cli:
|
|||
"""Run list of commands on remote device and return results
|
||||
"""
|
||||
connection = self._get_connection()
|
||||
return connection.run_commands(commands, check_rc)
|
||||
|
||||
try:
|
||||
return connection.run_commands(commands, check_rc)
|
||||
except ConnectionError as exc:
|
||||
self._module.fail_json(msg=to_text(exc))
|
||||
|
||||
def load_config(self, config, return_error=False, opts=None):
|
||||
"""Sends configuration commands to the remote device
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue