miron0xff / vyatta-conf-parser

Config parser for Vyatta/VyOS
MIT License
20 stars 11 forks source link

ParserException #3

Closed reversecipher closed 9 years ago

reversecipher commented 9 years ago

Parsing BGP IPv6 address-family causes error.

For example:

protocols {
    bgp 1 {
        address-family {
            ipv6-unicast {
                network 2001:2000:6000::/40 {
                }
                network 2001:2001:6000::/40 {
                }
                network 2001:2003::/32 {
                }
                network 2001:2060::/32 {
                }
            }
        }
        neighbor 10.10.1.2 {
            remote-as 2
        }
        network 192.168.1.0/24 {
        }
    }
}

Leads to:

Traceback (most recent call last):
  File "parse.py", line 105, in <module>
    print parse_conf(data)
  File "parse.py", line 97, in parse_conf
    c, headers = parse_node(c, line, headers)
  File "parse.py", line 86, in parse_node
    raise ParserException('Parse error: "%s"' % line)
__main__.ParserException: Parse error: "}"

I don't get the error when running without the address-family statement.

miron0xff commented 9 years ago

Thanks for this issue. It was really silly error in the age of IPv6. New version is on PyPI now.