napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

Fix #138 and #139 #148

Closed mirceaulinic closed 7 years ago

mirceaulinic commented 7 years ago
Ping @jeffgallagher - would you mind testing this branch?
jeffgallagher commented 7 years ago

@mirceaulinic - From my perspective #138 is good - single int value returned.

139 is fixed - the outer key is now a correct global VRF and not the routing instance.. i.e. inet.0 etc are now considered to be a part of the global vrf.

Both items can be closed from my testing.

This does still leave one item that is likely a separate issue, but I will mention it here since one solution would touch this code and relates somewhat to #139:

In JunOS we now have:

get_bgp_neighbors(): Outer key values: global

get_bgp_neighbors_detail(): Outer key values: global

Where both outer keys are now (correctly) listed as global. (I say correct since the documentation for get_bgp_neighbors indicates that the first (outer) dictionary will be 'global' if there is no VRF. )

However, run the same basic query against a Cisco XR box and you get:

get_bgp_neighbors(): Outer key values: global

get_bgp_neighbors_detail(): Outer key values: default

JunOS returns 'global' for both calls when there is no VRF, however IOSXR returns 'global' for the neighbor() call but 'default' for the neighbor_detail().

Either best to rename/default everything to 'default' or everything to 'global' - probably not wise to return different values for different OS types. I did have a collision on the XR side as well when both values came back different. Relative to #139 one option is to convert all things to 'default' from global.

Perhaps this is better addressed on the Cisco side. Otherwise code runs great.

dbarrosop commented 7 years ago

JunOS returns 'global' for both calls when there is no VRF, however IOSXR returns 'global' for the neighbor() call but 'default' for the neighbor_detail().

@jeffgallagher that is a bug on the IOSXR side, everything should be global for consistency. It's actually reported already: https://github.com/napalm-automation/napalm-iosxr/issues/115

@mirceaulinic looks like CI is broken

mirceaulinic commented 7 years ago

Yes @dbarrosop - I will com back to this and find the cause.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling e017a361ad89b469b581ce648ac9309129aa6998 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

mirceaulinic commented 7 years ago

@jeffgallagher I have applied some changes, could you please try again? What Junos version do you have? Would you be able to test agains Junos < 13 and Junos > 13?

@dbarrosop the CI is fixed, but I would like to have another testcase for Junos > 13.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 31a60a0e273d884ab2c7d0938456bdb355c05930 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 31a60a0e273d884ab2c7d0938456bdb355c05930 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 31a60a0e273d884ab2c7d0938456bdb355c05930 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 0ca3a56dd920acf28cb1686b4f12794f04b52fee on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 0ca3a56dd920acf28cb1686b4f12794f04b52fee on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 01d11e4a496600b407a5286ecf12ffbf44fedcd3 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 01d11e4a496600b407a5286ecf12ffbf44fedcd3 on mirceaulinic:bgp-neigh-det-139 into on napalm-automation:develop.

mirceaulinic commented 7 years ago

I have identified a major bug in this method: https://github.com/napalm-automation/napalm-junos/issues/149 I think we need to refactor it from scratch and decline this PR, but first let me come redesign and code.

mirceaulinic commented 7 years ago

I am going to merge this PR for the test cases & other testing features. Refactoring to follow