Right now all you can get if your config fails to parse is the character position in the file, which is very unfriendly.
Adding line number and position to the error messages would already be an improvement, even before we have real parse errors.
Right now all you can get if your config fails to parse is the character position in the file, which is very unfriendly.
Adding line number and position to the error messages would already be an improvement, even before we have real parse errors.
>>> s=""" ... foo { ... bar { ... baz quux foo ... } ... } ... """ >>> import vyos.configtree >>> c = vyos.configtree.ConfigTree(s) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3/dist-packages/vyos/configtree.py", line 167, in __init__ raise ValueError("Failed to parse config: {0}".format(msg)) ValueError: Failed to parse config: Syntax error on line 4, character 14: Invalid syntax.