napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

MergeConfigException: return the command caused error #184

Closed sincerywaing closed 7 years ago

sincerywaing commented 7 years ago

Description of Issue/Question

when we are trying to load_merge_candidate, if it crashes, we may want to know which command caused the crash.

napalm-ios has a similar pr: https://github.com/napalm-automation/napalm-ios/pull/178

Discussion in pyez: https://github.com/Juniper/py-junos-eznc/issues/759#issuecomment-315277539

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

[ *] Yes [ ] No

Setup

load a command caused error

napalm-junos version

(Paste verbatim output from pip freeze | grep napalm-junos between quotes below)

0.11.0

JunOS version

(Paste verbatim output from show version and haiku between quotes below)

any

Steps to Reproduce the Issue

load a sets of command that cause error (wrong command)

Error Traceback

(Paste the complete traceback of the exception between quotes below)

error: syntax error
error: syntax error
error: syntax error
error: syntax error
error: syntax error, expecting <statement>, <attribute-name>, <flag-value>, or <identifier>
dbarrosop commented 7 years ago

I am actually not sure the device returns that information.

dbarrosop commented 7 years ago

Ok, it does. See the linked PR for a potential solution.

sincerywaing commented 7 years ago

nice! Thanks @dbarrosop