eos handles error gracefully when maximum sessions is reached (#41242)

* to resolve #36977

* to resolve #36977

* fix review comment
This commit is contained in:
Sumit Jaiswal 2018-06-08 10:29:42 +05:30 committed by GitHub
parent e3a073fdb9
commit 91ecb87b73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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:

View file

@ -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):