codeout / junoser

PEG parser for JUNOS configuration.
MIT License
69 stars 11 forks source link

bgp community members with bracket syntax flagged as invalid #25

Closed xv0x7c0 closed 3 years ago

xv0x7c0 commented 3 years ago

Hi,

First, thanks for the great work !

Just testing junoser vs. a couple of configs at hand and found that it doesn't like specifying community members as a list in a single line statement.

The following line triggers an invalid syntax error :

set policy-options community COMM_TEST members [ 64496:1 64496:2 ]

Any hint ? Thx !

codeout commented 3 years ago

HI, this is a junoser bug. (Juniper's actually)

set policy-options community COMM_TEST members one_word

# or

set policy-options community COMM_TEST members "quoted words"

The syntax above is valid according to the Juniper .xsd.

          <xsd:element name="members" minOccurs="0" maxOccurs="unbounded" type="xsd:string">
            <xsd:annotation>
              <xsd:documentation>Community members</xsd:documentation>
              <xsd:appinfo>
                <flag>mustquote</flag>
                <flag>twig-dynamic-db-ok</flag>
                <flag>current-product-support</flag>
              </xsd:appinfo>
            </xsd:annotation>
          </xsd:element>

I can fix it anyways. Thanks for your report.

codeout commented 3 years ago

Hi,

I've pushed fixes to this repo. Will publish it as a gem in a week. In the meantime, you can try GitHub based gem:

gem install specific_install
gem specific_install https://github.com/codeout/junoser
xv0x7c0 commented 3 years ago

I just tested and the error is not present anymore 👍 Thanks for the fix !

codeout commented 3 years ago

Thanks for your testing! v0.4.1 has been just published.