eos handles error gracefully when maximum sessions is reached (#41242)
* to resolve #36977 * to resolve #36977 * fix review comment
This commit is contained in:
parent
e3a073fdb9
commit
91ecb87b73
2 changed files with 3 additions and 2 deletions
|
@ -205,7 +205,7 @@ class Cli:
|
||||||
return conn.load_config(commands, commit, replace)
|
return conn.load_config(commands, commit, replace)
|
||||||
except ConnectionError as exc:
|
except ConnectionError as exc:
|
||||||
message = getattr(exc, 'err', exc)
|
message = getattr(exc, 'err', exc)
|
||||||
self._module.fail_json(msg="Error on executing commands %s" % commands, data=to_text(message, errors='surrogate_then_replace'))
|
self._module.fail_json(msg="%s" % message, data=to_text(message, errors='surrogate_then_replace'))
|
||||||
|
|
||||||
|
|
||||||
class Eapi:
|
class Eapi:
|
||||||
|
|
|
@ -45,7 +45,8 @@ class TerminalModule(TerminalBase):
|
||||||
re.compile(br"[^\r\n]+ not found", re.I),
|
re.compile(br"[^\r\n]+ not found", re.I),
|
||||||
re.compile(br"'[^']' +returned error code: ?\d+"),
|
re.compile(br"'[^']' +returned error code: ?\d+"),
|
||||||
re.compile(br"[^\r\n]\/bin\/(?:ba)?sh"),
|
re.compile(br"[^\r\n]\/bin\/(?:ba)?sh"),
|
||||||
re.compile(br"% More than \d+ OSPF instance", re.I)
|
re.compile(br"% More than \d+ OSPF instance", re.I),
|
||||||
|
re.compile(br"Maximum number of pending sessions has been reached")
|
||||||
]
|
]
|
||||||
|
|
||||||
def on_open_shell(self):
|
def on_open_shell(self):
|
||||||
|
|
Loading…
Reference in a new issue