Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOS: get_route_to() does not support confederations #736

Closed
bewing opened this issue May 22, 2018 · 0 comments
Closed

EOS: get_route_to() does not support confederations #736

bewing opened this issue May 22, 2018 · 0 comments
Assignees

Comments

@bewing
Copy link
Member

bewing commented May 22, 2018

Router output:

{
    "vrfs": {
        "default": {
            "routerId": "192.0.2.48",
            "vrf": "default",
            "bgpRouteEntries": {
                "192.0.2.0/24": {
                    "totalPaths": 2,
                    "bgpAdvertisedPeerGroups": {
                        "INTERNAL-TOR": {
                            "peerList": [
                                "192.0.2.223"
                            ]
                        }
                    },
                    "totalAdvertisedPeers": 1,
                    "maskLength": 16,
                    "bgpRoutePaths": [
                        {
                            "asPathEntry": {
                                "asPathType": "Confed-External",
                                "asPath": "(20901 21149)"
                            },
                            "med": 175,
                            "localPreference": 100,
                            "weight": 0,
                            "reasonNotBestpath": "noReason",
                            "timestamp": 1526591713,
                            "nextHop": "192.0.4.221",
                            "routeType": {
                                "atomicAggregator": false,
                                "origin": "Igp",
                                "suppressed": false,
                                "queued": false,
                                "valid": true,
                                "ecmpContributor": true,
                                "luRoute": false,
                                "active": true,
                                "stale": false,
                                "ecmp": true,
                                "backup": false,
                                "ecmpHead": true,
                                "ucmp": false
                            },
                            "routeDetail": {
                                "origin": "Igp",
                                "peerEntry": {
                                    "peerRouterId": "192.0.2.1",
                                    "peerAddr": "192.0.2.221"
                                },
                                "tunnelRibEligible": false,
                                "extCommunityList": [],
                                "communityList": [],
                                "rxSafi": "Unicast",
                                "aggregator": " (aggregated by 65001 192.0.255.49)",
                                "recvdFromRRClient": false,
                                "labelStack": []
                            }
                        },
                        {
                            "asPathEntry": {
                                "asPathType": "Confed-External",
                                "asPath": "(20902 21149)"
                            },
                            "med": 175,
                            "localPreference": 100,
                            "weight": 0,
                            "reasonNotBestpath": "ecmpFast",
                            "timestamp": 1526591756,
                            "nextHop": "192.0.4.223",
                            "routeType": {
                                "atomicAggregator": false,
                                "origin": "Igp",
                                "suppressed": false,
                                "queued": false,
                                "valid": true,
                                "ecmpContributor": true,
                                "luRoute": false,
                                "active": false,
                                "stale": false,
                                "ecmp": true,
                                "backup": false,
                                "ecmpHead": false,
                                "ucmp": false
                            },
                            "routeDetail": {
                                "origin": "Igp",
                                "peerEntry": {
                                    "peerRouterId": "192.0.2.2",
                                    "peerAddr": "192.0.2.223"
                                },
                                "tunnelRibEligible": false,
                                "extCommunityList": [],
                                "communityList": [],
                                "rxSafi": "Unicast",
                                "aggregator": " (aggregated by 65001 192.0.2.49)",
                                "recvdFromRRClient": false,
                                "labelStack": []
                            }
                        }
                    ],
                    "address": "192.0.2.0"
                }
            },
            "asn": 20948
        }
    }
}

Error message:

ValueError                                Traceback (most recent call last)
<ipython-input-2-c5a9e185b0d9> in <module>()
      5
      6 with EOSDriver("router", "bewing", getpass()) as d:
----> 7     pprint(d.get_route_to("192.0.2.0/24"))
      8
      9

/mnt/c/Users/bewing/PycharmProjects/napalm/napalm/eos/eos.py in get_route_to(self, destination, protocol)
   1130                         bgp_route = route.copy()
   1131                         as_path = bgp_route_details.get('asPathEntry', {}).get('asPath', u'')
-> 1132                         remote_as = int(as_path.split()[-1])
   1133                         remote_address = napalm.base.helpers.ip(bgp_route_details.get(
   1134                             'routeDetail', {}).get('peerEntry', {}).get('peerAddr', ''))

ValueError: invalid literal for int() with base 10: '21149)'
@bewing bewing self-assigned this May 22, 2018
bewing added a commit that referenced this issue May 22, 2018
@bewing bewing mentioned this issue May 22, 2018
bewing added a commit that referenced this issue May 24, 2018
* Add test case for #736

* Strip parans from path when doing remote_as in get_route_to
bewing added a commit that referenced this issue May 24, 2018
* develop:
  Fix #736 (get_route_to bgp confed) (#737)
ExaneServerTeam pushed a commit to ExaneServerTeam/napalm that referenced this issue Mar 6, 2020
…n#737)

* Add test case for napalm-automation#736

* Strip parans from path when doing remote_as in get_route_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant