<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script for compare route in Nexus switch. in Network Devices</title>
    <link>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276680#M566</link>
    <description>&lt;P&gt;Nexus has a different output format than IOS; It doesn't look like the script is meant to work with Nexus-formatted output. The parseroute class seems to have failed to parse the file correctly resulting in a non-existent elements['ad']. You might try manually editing the Nexus output so each route is on a single line, but I suspect that won't be enough.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 06:54:06 GMT</pubDate>
    <dc:creator>ulineosan</dc:creator>
    <dc:date>2025-03-31T06:54:06Z</dc:date>
    <item>
      <title>Python script for compare route in Nexus switch.</title>
      <link>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276665#M565</link>
      <description>&lt;P&gt;I have referred to the route compare script at Github, and customized it and display the result in table format. It's working good on Cisco IOS platform, but it's failed at NXOS...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to run it by comparing the "show ip route" results. And got the error message:-&lt;/P&gt;&lt;P&gt;============================================&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "/home/./route_compare.py", line 349, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "/home/./route_compare.py", line 324, in main&lt;BR /&gt;parse1.main(object1.result)&lt;BR /&gt;File "/home/./route_compare.py", line 232, in main&lt;BR /&gt;routes[nlocation]['ad{0}'.format(mroutecount)] = elements['ad']&lt;BR /&gt;IndexError: list index out of range&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 05:59:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276665#M565</guid>
      <dc:creator>R T</dc:creator>
      <dc:date>2025-03-31T05:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for compare route in Nexus switch.</title>
      <link>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276680#M566</link>
      <description>&lt;P&gt;Nexus has a different output format than IOS; It doesn't look like the script is meant to work with Nexus-formatted output. The parseroute class seems to have failed to parse the file correctly resulting in a non-existent elements['ad']. You might try manually editing the Nexus output so each route is on a single line, but I suspect that won't be enough.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 06:54:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276680#M566</guid>
      <dc:creator>ulineosan</dc:creator>
      <dc:date>2025-03-31T06:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for compare route in Nexus switch.</title>
      <link>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276731#M567</link>
      <description>&lt;P class="whitespace-pre-wrap break-words"&gt;Based on your errors here when your script is trying to add wrapped routes or ECMP routes, but it can't find the "parent" route element this is why it appears to be failing due to the differences in route output format between IOS and NX.&lt;/P&gt;
&lt;P class="whitespace-pre-wrap break-words"&gt;You can fix this by&amp;nbsp;&lt;SPAN&gt;adding a condition checking if &lt;/SPAN&gt;&lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]"&gt;routes&lt;/CODE&gt;&lt;SPAN&gt; list is not empty before accessing &lt;/SPAN&gt;&lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.3rem] px-1 py-px text-[0.9rem]"&gt;nlocation&lt;/CODE&gt;&lt;SPAN&gt; index&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 09:16:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276731#M567</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-03-31T09:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for compare route in Nexus switch.</title>
      <link>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276790#M568</link>
      <description>&lt;P&gt;I'd like to suggest - before starting to parse NXOS-CLI-Output - there is a CLI-Pipe-Construct "JSON" available - so the NXOS provides easily to parse Output inJSON-Format&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# show ip route | json&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 11:49:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-devices/python-script-for-compare-route-in-nexus-switch/m-p/5276790#M568</guid>
      <dc:creator>r.heitmann</dc:creator>
      <dc:date>2025-03-31T11:49:58Z</dc:date>
    </item>
  </channel>
</rss>

