Closed sidhoah8 closed 5 years ago
Thanks a lot @hedin. Works great now!
First, thanks for the issue, @sidhoah8 . I've updated code, added test for your case and uploaded new version on pypi.
You are difficult to follow how parser works not because you are new to Python. Parser was written long time ago in a great hurry. So instead of write grammar for config and parser for it regular expressions were used.
Every half a year when new issue appears it is difficult for me too to read and update the parser. Actually I don't know how it works now. I just write test, set a breakpoint near line where exception occurs and patch it until exception disappears and all tests pass.
Ok, thanks. That's reassuring! It has saved me a lot of time writing my scripts so I'm grateful that you wrote and shared it :-)
Hi @hedin,
I'm working with AT&T Vyatta vRouter configs and have an issue with some named sections that don't have any curly brackets/braces, like "{" and "}". I assume these are left over config statements that haven't been fully cleaned up... but I don't have control over the devices to always get such statements removed. For example with the following config statement (note "vti vti10"):
will result in the following error:
If I change the order so that the config statement without brackets in not the first entry, then it seems to be ok (see now "vti vti11"):
By inserting the following at line 73:
my scripts work again... though I'll be honest, I haven't tested to see if I lose that non-bracketed statement... but I don't need it either.
Maybe you can find a way to catch this issue? I'll also have a look as well.. though I'm new to Python and finding it difficult to follow how the parser works :-(
Let me know if you need anything more from me.