napalm-automation-community / napalm-netiron

NAPALM NetIron driver for Brocade / Extreme devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bgp neighbors not working

helpdeskdan opened this issue · comments

>>> device.open()
>>> device.get_bgp_neighbors()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/dist-packages/napalm_netiron/netiron.py", line 1478, in get_bgp_neighbors
    IPV4_ADDR_REGEX, IPV6_ADDR_REGEX, ASN_REGEX), line)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 924, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.7/sre_parse.py", line 420, in _parse_sub
    not nested and not items))
  File "/usr/lib/python3.7/sre_parse.py", line 813, in _parse
    source.tell() - start)
re.error: missing ), unterminated subpattern at position 4
>>>

Sorry, I should have at least looked at it. It's an easy fix:

1476                 r'^\s+(?P({}|{}))\s+(?P({}))\s+(?P\S+)\s+'

To bold that missing parenthesis:
r'^\s+(?P<remote_addr>({}|{}))\s+(?P<remote_as>({}))\s+(?P\S+)\s+'

Some python3 fixes might be good - unicode for instance. Thkx for the project work.

#*@&, rob has already fixed both - check the pull