napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

fix family in get_bgp_neighbors() #217

Closed ckishimo closed 6 years ago

ckishimo commented 6 years ago

This fixes the address_family name reported in get_bgp_neighbors(). After configuring evpn, there are two tables reported bgp.evpn.0 and default-switch.evpn.0. With the current code, both families are merged into a single table called evpn, but then the results of accepted/received/sent_prefixes are not correct With the current code:

            "10.92.99.92": {
                "address_family": {
                    "evpn": {
                        "accepted_prefixes": 1, 
                        "received_prefixes": 1, 
                        "sent_prefixes": 0
                    }, 

With the new code:

                "address_family": {
                    "bgp.evpn": {
                        "accepted_prefixes": 1, 
                        "received_prefixes": 1, 
                        "sent_prefixes": 14
                    }, 
                    "default-switch.evpn": {
                        "accepted_prefixes": 1, 
                        "received_prefixes": 1, 
                        "sent_prefixes": 0
                    }, 

This is breaking the mocked data for get_bgp_neighbors.....please let me know what you think. Thanks

dbarrosop commented 6 years ago

I am not sure I understand what bgp.evpn and default-switch.evpn are, can you clarify? If I understand this correctly the structure in Junos is: $routing-instance.$family.0. Which means in your case you should have two instances; bgp and default-switch which in turn each one has an evpn address family.

ckishimo commented 6 years ago

It's not clear to me either :P and I agree with you about the structure $routing-instance.$family.0 but the prefixes counters do not add up. I'm closing and we can have a look once the "reunification" is over. Thanks again