* Detect overlapping subnet & provide better errors
(cherry picked from commit dba975470d
)
This commit is contained in:
parent
d48ebcee40
commit
f320b1507d
2 changed files with 7 additions and 2 deletions
|
@ -440,7 +440,11 @@ class Eapi:
|
||||||
commands = ['configure session %s' % session, 'abort']
|
commands = ['configure session %s' % session, 'abort']
|
||||||
self.send_request(commands)
|
self.send_request(commands)
|
||||||
err = response['error']
|
err = response['error']
|
||||||
self._module.fail_json(msg=err['message'], code=err['code'])
|
error_text = []
|
||||||
|
for data in err['data']:
|
||||||
|
error_text.extend(data.get('errors', []))
|
||||||
|
error_text = '\n'.join(error_text) or err['message']
|
||||||
|
self._module.fail_json(msg=error_text, code=err['code'])
|
||||||
|
|
||||||
commands = ['configure session %s' % session, 'show session-config diffs']
|
commands = ['configure session %s' % session, 'show session-config diffs']
|
||||||
if commit:
|
if commit:
|
||||||
|
|
|
@ -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"% Subnet [0-9a-f.:/]+ overlaps", re.I),
|
||||||
]
|
]
|
||||||
|
|
||||||
def on_open_shell(self):
|
def on_open_shell(self):
|
||||||
|
|
Loading…
Reference in a new issue