napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

fix route_reflector_client in get_bgp_config() #214

Closed ckishimo closed 7 years ago

ckishimo commented 7 years ago

This fixes the route_reflector_client key in get_bgp_config(), as far as I can see it's always set to False. This should work when applying the cluster command in group or neighbors level, but not in global config. As far as I can see all commands applied globally are ignored, not sure if there is a reason for that. With the following configuration example:

group internal {
    type internal;
    local-address 10.99.1.2;
    cluster 6.6.6.6;
    neighbor 10.10.10.10 {
        description routerA;
    }
    neighbor 20.20.20.20 {
        description routerB;
    }
}

both neighbors are route reflectors clients:

carles@vmx# run show bgp neighbor | display xml | match "peer-address|client" 
            <peer-address>10.10.10.10</peer-address>
            <route-reflector-client/>
            <peer-address>20.20.20.20</peer-address>
            <route-reflector-client/>

so the output from get_bgp_config() should be:

        "neighbors": {
            "10.10.10.10": {
                "description": "routerA", 
                "route_reflector_client": true
            "20.20.20.20": {
                "description": "routerB", 
                "route_reflector_client": true

Please let me know if I missed something or if it's breaking other things...thanks

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.3%) to 78.514% when pulling 4623a1132377f104730a72c81ae47e3e6b1d2722 on ckishimo:devel-rr into b087b8b0ea90d0b8fb88a3315bc72e97b36d5d44 on napalm-automation:develop.