weixin_39564527
weixin_39564527
2021-01-01 14:09

UnboundLocalError: local variable 'ospf_dict' referenced before assignment

Running the parser for show ip protocols on a ASR920; IOS-XE 16.09.2.

Running from either ipyats or a robot file hitting the following error. Can this be set to ignore 'ospf' commands during run?


In [1]: from genie.libs.parser.iosxe.show_protocols import ShowIpProtocols                                                                                                                

In [2]:                                                                                                                                                                                   

In [2]:                                                                                                                                                                                   

In [2]:                                                                                                                                                                                   

In [2]: lab920 = testbed.devices['LAB-ASR920-24SZ-2']                                                                                                                                     

In [3]: lab920.connect()                                                                                                                                                                  
[2019-02-27 18:41:19,597] +++ LAB-ASR920-24SZ-2 logfile /tmp/LAB-ASR920-24SZ-2-cli-20190227T184119596.log +++
[2019-02-27 18:41:19,598] +++ Unicon plugin iosxe +++
[2019-02-27 18:41:19,603] +++ connection to spawn: ssh -l dduser 10.50.15.11 -p 22, id: 139862119761960 +++
[2019-02-27 18:41:19,605] connection to LAB-ASR920-24SZ-2
[2019-02-27 18:41:19,609] ssh -l dduser 10.50.15.11 -p 22

<<logs ommited from connect>>

Out[3]: '[2019-02-27 18:41:19,609] ssh -l dduser 10.50.15.11 -p 22\r\n\r\r\n*******************************************************************************\r\r\n\r\r\n  This is a private computer system. It is for authorized use only. Users\r\r\n  (authorized or unauthorized) have no explicit or implicit expectation of\r\r\n  privacy.\r\r\n\r\r\n  Any or all uses of this system and all files on this system may be\r\r\n  intercepted, monitored, recorded, copied, audited, inspected, and\r\r\n  disclosed to authorized site, law enforcement personnel, as well as\r\r\n  authorized officials of other agencies.  By using this system, the user\r\r\n  consents to such interception, monitoring, recording, copying, auditing,\r\r\n  inspection, and disclosure at the discretion of authorized site personnel.\r\r\n\r\r\n  Unauthorized or improper use of this system may result in administrative\r\r\n  disciplinary action and civil and criminal penalties. By continuing to\r\r\n  use this system you indicate your awareness of and consent to these terms\r\r\n  and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the\r\r\n  conditions stated in this warning.  Have a nice day.\r\r\n\r\r\n*******************************************************************************\r\r\npassword: \r\n\r\n*******************************************************************************\r\n           Description:    Nsight Corporate 470 Lab ASR920-24SZ-IM 2\r\n           Hostname:       CC4CORPLBB12.eng.nsight.com\r\n           Machine Type:   Cisco ASR920-24SZ-IM\r\n           Loc ID:         70871\r\n           Location:       Nsight Crop 470 Lab A3, Green Bay, WI\r\n*******************************************************************************\r\n\r\nLAB-ASR920-24SZ-2#'

In [4]:                                                                                                                                                                                   

In [4]:                                                                                                                                                                                   

In [4]: ShowIpProtocols(lab920)                                                                                                                                                           

In [5]: proto = ShowIpProtocols(lab920)                                                                                                                                                   

In [7]: proto.parse()                                                                                                                                                                     
[2019-02-27 18:42:34,631] +++ LAB-ASR920-24SZ-2: executing command 'show ip protocols' +++
show ip protocols
*** IP Routing is NSF aware ***

Routing Protocol is "application"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Maximum path: 32
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 4)

Routing Protocol is "isis network_mpls"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: isis network_mpls
  Address Summarization:
    None
  Maximum path: 4
  Routing for Networks:
    TenGigabitEthernet0/0/26
    TenGigabitEthernet0/0/27
  Passive Interface(s):
    Loopback0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.239.6.3           115      05:56:34
    10.239.6.2           115      05:56:34
    10.239.6.4           115      05:56:34
    10.239.6.9           115      05:56:34
  Distance: (default is 115)

Routing Protocol is "bgp 9999"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  IGP synchronization is disabled
  Automatic route summarization is disabled
  Maximum path: 1
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.239.6.3           200      12w5d
    10.239.6.2           200      14w4d
  Distance: external 20 internal 200 local 200

LAB-ASR920-24SZ-2#
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
~/pyats_dev/sandbox/lib64/python3.6/site-packages/ipyats/main.py in <module>
----> 1 proto.parse()

~/pyats_dev/sandbox/lib64/python3.6/site-packages/genie/metaparser/_metaparser.cpython-36m-x86_64-linux-gnu.so in genie.metaparser._metaparser.MetaParser.parse()

~/pyats_dev/sandbox/lib64/python3.6/site-packages/genie/libs/parser/iosxe/show_protocols.py in cli(self, output)
    394                 elif passive_interfaces is not None:
    395                     passive_interfaces.append(str(m.groupdict()['interface']))
--> 396                     ospf_dict['passive_interfaces'] = passive_interfaces
    397                 continue
    398 

UnboundLocalError: local variable 'ospf_dict' referenced before assignment
</module></logs>

该提问来源于开源项目:CiscoTestAutomation/genieparser

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

20条回答

  • weixin_39992831 weixin_39992831 3月前

    Hello , you said in the original post that you have no issue with NXOS, but you gave me the output from NXOS. I just verified the output you provided with the latest beta package v19.10.1b2 and the result is good. The error that you posted from IOS. Can you please verify again and provide me with the output that you have issue with?

    Thanks, --Thai.

    点赞 评论 复制链接分享
  • weixin_39687189 weixin_39687189 3月前

    Hi, Thai!

    Please concentrate on the "c7600_show_inv.txt" file. It has details about power supplies and fans which are installed in the chassis. The ios-xe parser returns nothing about them! Please test it and you can see the issue.

    Thank you.

    /Alexander

    On Fri, Nov 8, 2019 at 9:22 PM THAI NGUYEN wrote:

    Hello https://github.com/nettworker , you said in the original post that you have no issue with NXOS, but you gave me the output from NXOS. I just verified the output you provided with the latest beta package v19.10.1b2 and the result is good. The error that you posted from IOS. Can you please verify again and provide me with the output that you have issue with?

    Thanks, --Thai.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CiscoTestAutomation/genieparser/issues/8?email_source=notifications&email_token=AD6SBSX2WKDGABICRRLI5B3QSWU55A5CNFSM4G2U22SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDS6H6Q#issuecomment-551937018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6SBSVAJVHYYIEWSF2A4GTQSWU55ANCNFSM4G2U22SA .

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Hello . Thanks, i will take a look at the c7600 and let you know.

    --Thai.

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Hello , I just tried the output that you provided with XE parser. It worked fine. Can you please try again with IOSXE instead of IOS and let me know?

    Thanks, --Thai.

    点赞 评论 复制链接分享
  • weixin_39687189 weixin_39687189 3月前

    Hi, NGuyen!

    Maybe your parser works fine but where is Power supply and Fan tray data in the parsed output (see below)?

    $ python3 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

    raw_data = ''' ... NAME: "CISCO7606-S", DESCR: "Cisco Systems Cisco 7600 6-slot Chassis System" ... PID: CISCO7606-S , VID: V02, SN: FOX1410G7D0 ... ... NAME: "CLK-7600 1", DESCR: "OSR-7600 Clock FRU 1" ... PID: CLK-7600 , VID: , SN: NWG140305D7 ... ... NAME: "CLK-7600 2", DESCR: "OSR-7600 Clock FRU 2" ... PID: CLK-7600 , VID: , SN: NWG140305D7 ... ... NAME: "module 1", DESCR: "WS-X6708-10GE CEF720 8 port 10GE with DFC Rev. 2.5" ... PID: WS-X6708-10GE , VID: V12, SN: SAL14028GKA ... ... NAME: "switching engine sub-module of 1", DESCR: "WS-F6700-DFC3CXL Distributed Forwarding Card 3 Rev. 1.10" ... PID: WS-F6700-DFC3CXL , VID: V04, SN: SAL1416G260 ... ... NAME: "Transceiver Te1/1", DESCR: "Transceiver 10Gbase-SR Te1/1" ... PID: X2-10GB-SR , VID: V04 , SN: ONT140302N5 ... ... NAME: "Transceiver Te1/2", DESCR: "Transceiver 10Gbase-SR Te1/2" ... PID: X2-10GB-SR , VID: V04 , SN: ONT140702KM ... ... NAME: "Transceiver Te1/3", DESCR: "Transceiver 10Gbase-LR Te1/3" ... PID: X2-10GB-LR , VID: V05 , SN: AGA1631X25J ... ... NAME: "Transceiver Te1/4", DESCR: "Transceiver 10Gbase-LR Te1/4" ... PID: X2-10GB-LR , VID: V04 , SN: AGA1406XL1Z ... ... NAME: "Transceiver Te1/5", DESCR: "Transceiver 10Gbase-LR Te1/5" ... PID: X2-10GB-LR , VID: V03 , SN: XX96L013 ... ... NAME: "Transceiver Te1/6", DESCR: "Transceiver 10Gbase-LR Te1/6" ... PID: X2-10GB-LR , VID: V05 , SN: AGA1631X1M0 ... ... NAME: "Transceiver Te1/7", DESCR: "Transceiver 10Gbase-LR Te1/7" ... PID: X2-10GB-LR , VID: V04 , SN: AGA1404XBQX ... ... NAME: "Transceiver Te1/8", DESCR: "Transceiver 10Gbase-LR Te1/8" ... PID: X2-10GB-LR , VID: V04 , SN: AGA1407XQY2 ... ... NAME: "module 2", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 3.4" ... PID: WS-X6748-GE-TX , VID: V04, SN: SAL1411CUS6 ... ... NAME: "switching engine sub-module of 2", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" ... PID: WS-F6700-CFC , VID: V06, SN: SAL1413E7Y4 ... ... NAME: "module 3", DESCR: "WS-X6724-SFP CEF720 24 port 1000mb SFP Rev. 4.4" ... PID: WS-X6724-SFP , VID: V07, SN: SAL1430P5Y4 ... ... NAME: "switching engine sub-module of 3", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" ... PID: WS-F6700-CFC , VID: V06, SN: SAL1430NWPY ... ... NAME: "Transceiver Gi3/1", DESCR: "Transceiver 1000BaseLH Gi3/1" ... PID: GLC-LH-SMD , VID: 002 , SN: AVJ18373BWG ... ... NAME: "Transceiver Gi3/2", DESCR: "Transceiver 1000BaseT Gi3/2" ... PID: N/A , VID: E , SN: MTC184007T2 ... ... NAME: "Transceiver Gi3/7", DESCR: "Transceiver 1000BaseLH Gi3/7" ... PID: N/A , VID: A0 , SN: SA1F610142 ... ... NAME: "Transceiver Gi3/10", DESCR: "Transceiver 1000BaseLH Gi3/10" ... PID: SFP-GE-L , VID: A , SN: SPC161903KB ... ... NAME: "Transceiver Gi3/11", DESCR: "Transceiver 1000BaseLH Gi3/11" ... PID: SFP-GE-L , VID: A , SN: SPC161903KC ... ... NAME: "module 4", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 4.2" ... PID: WS-X6748-GE-TX , VID: V05, SN: SAL1641PAG0 ... ... NAME: "switching engine sub-module of 4", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" ... PID: WS-F6700-CFC , VID: V06, SN: SAL1638NCMG ... ... NAME: "module 5", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9" ... PID: RSP720-3C-GE , VID: V09, SN: JAE14160K9H ... ... NAME: "msfc sub-module of 5", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5" ... PID: 7600-MSFC4 , VID: 000, SN: JAE141601VE ... ... NAME: "switching engine sub-module of 5", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2" ... PID: 7600-PFC3C , VID: 000, SN: JAE14150L5S ... ... NAME: "Transceiver Gi5/1", DESCR: "Transceiver 1000BaseLH Gi5/1" ... PID: N/A , VID: A0 , SN: H11L057 ... ... NAME: "module 6", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9" ... PID: RSP720-3C-GE , VID: V09, SN: JAE14270GMC ... ... NAME: "msfc sub-module of 6", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5" ... PID: 7600-MSFC4 , VID: 000, SN: JAE142709J2 ... ... NAME: "switching engine sub-module of 6", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2" ... PID: 7600-PFC3C , VID: 000, SN: JAE14270H9A ... ... NAME: "FAN-MOD-6SHS 1", DESCR: "High Speed Fan Module for CISCO7606-S 1" ... PID: FAN-MOD-6SHS , VID: V01, SN: DCH1411002X ... ... NAME: "PS 1 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 1" ... PID: PWR-2700-DC , VID: V03, SN: APS141400NV ... ... NAME: "PS 2 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 2" ... PID: PWR-2700-DC , VID: V03, SN: APS141400NK ... '''

    raw_data '\nNAME: "CISCO7606-S", DESCR: "Cisco Systems Cisco 7600 6-slot Chassis System"\nPID: CISCO7606-S , VID: V02, SN: FOX1410G7D0\n\nNAME: "CLK-7600 1", DESCR: "OSR-7600 Clock FRU 1"\nPID: CLK-7600 , VID: , SN: NWG140305D7\n\nNAME: "CLK-7600 2", DESCR: "OSR-7600 Clock FRU 2"\nPID: CLK-7600 , VID: , SN: NWG140305D7\n\nNAME: "module 1", DESCR: "WS-X6708-10GE CEF720 8 port 10GE with DFC Rev. 2.5"\nPID: WS-X6708-10GE , VID: V12, SN: SAL14028GKA\n\nNAME: "switching engine sub-module of 1", DESCR: "WS-F6700-DFC3CXL Distributed Forwarding Card 3 Rev. 1.10"\nPID: WS-F6700-DFC3CXL , VID: V04, SN: SAL1416G260\n\nNAME: "Transceiver Te1/1", DESCR: "Transceiver 10Gbase-SR Te1/1"\nPID: X2-10GB-SR , VID: V04 , SN: ONT140302N5\n\nNAME: "Transceiver Te1/2", DESCR: "Transceiver 10Gbase-SR Te1/2"\nPID: X2-10GB-SR , VID: V04 , SN: ONT140702KM\n\nNAME: "Transceiver Te1/3", DESCR: "Transceiver 10Gbase-LR Te1/3"\nPID: X2-10GB-LR , VID: V05 , SN: AGA1631X25J\n\nNAME: "Transceiver Te1/4", DESCR: "Transceiver 10Gbase-LR Te1/4"\nPID: X2-10GB-LR , VID: V04 , SN: AGA1406XL1Z\n\nNAME: "Transceiver Te1/5", DESCR: "Transceiver 10Gbase-LR Te1/5"\nPID: X2-10GB-LR , VID: V03 , SN: XX96L013 \n\nNAME: "Transceiver Te1/6", DESCR: "Transceiver 10Gbase-LR Te1/6"\nPID: X2-10GB-LR , VID: V05 , SN: AGA1631X1M0\n\nNAME: "Transceiver Te1/7", DESCR: "Transceiver 10Gbase-LR Te1/7"\nPID: X2-10GB-LR , VID: V04 , SN: AGA1404XBQX\n\nNAME: "Transceiver Te1/8", DESCR: "Transceiver 10Gbase-LR Te1/8"\nPID: X2-10GB-LR , VID: V04 , SN: AGA1407XQY2\n\nNAME: "module 2", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 3.4"\nPID: WS-X6748-GE-TX , VID: V04, SN: SAL1411CUS6\n\nNAME: "switching engine sub-module of 2", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1"\nPID: WS-F6700-CFC , VID: V06, SN: SAL1413E7Y4\n\nNAME: "module 3", DESCR: "WS-X6724-SFP CEF720 24 port 1000mb SFP Rev. 4.4"\nPID: WS-X6724-SFP , VID: V07, SN: SAL1430P5Y4\n\nNAME: "switching engine sub-module of 3", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1"\nPID: WS-F6700-CFC , VID: V06, SN: SAL1430NWPY\n\nNAME: "Transceiver Gi3/1", DESCR: "Transceiver 1000BaseLH Gi3/1"\nPID: GLC-LH-SMD , VID: 002 , SN: AVJ18373BWG \n\nNAME: "Transceiver Gi3/2", DESCR: "Transceiver 1000BaseT Gi3/2"\nPID: N/A , VID: E , SN: MTC184007T2 \n\nNAME: "Transceiver Gi3/7", DESCR: "Transceiver 1000BaseLH Gi3/7"\nPID: N/A , VID: A0 , SN: SA1F610142 \n\nNAME: "Transceiver Gi3/10", DESCR: "Transceiver 1000BaseLH Gi3/10"\nPID: SFP-GE-L , VID: A , SN: SPC161903KB \n\nNAME: "Transceiver Gi3/11", DESCR: "Transceiver 1000BaseLH Gi3/11"\nPID: SFP-GE-L , VID: A , SN: SPC161903KC \n\nNAME: "module 4", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 4.2"\nPID: WS-X6748-GE-TX , VID: V05, SN: SAL1641PAG0\n\nNAME: "switching engine sub-module of 4", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1"\nPID: WS-F6700-CFC , VID: V06, SN: SAL1638NCMG\n\nNAME: "module 5", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9"\nPID: RSP720-3C-GE , VID: V09, SN: JAE14160K9H\n\nNAME: "msfc sub-module of 5", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5"\nPID: 7600-MSFC4 , VID: 000, SN: JAE141601VE\n\nNAME: "switching engine sub-module of 5", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2"\nPID: 7600-PFC3C , VID: 000, SN: JAE14150L5S\n\nNAME: "Transceiver Gi5/1", DESCR: "Transceiver 1000BaseLH Gi5/1"\nPID: N/A , VID: A0 , SN: H11L057 \n\nNAME: "module 6", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9"\nPID: RSP720-3C-GE , VID: V09, SN: JAE14270GMC\n\nNAME: "msfc sub-module of 6", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5"\nPID: 7600-MSFC4 , VID: 000, SN: JAE142709J2\n\nNAME: "switching engine sub-module of 6", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2"\nPID: 7600-PFC3C , VID: 000, SN: JAE14270H9A\n\nNAME: "FAN-MOD-6SHS 1", DESCR: "High Speed Fan Module for CISCO7606-S 1"\nPID: FAN-MOD-6SHS , VID: V01, SN: DCH1411002X\n\nNAME: "PS 1 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 1"\nPID: PWR-2700-DC , VID: V03, SN: APS141400NV\n\nNAME: "PS 2 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 2"\nPID: PWR-2700-DC , VID: V03, SN: APS141400NK\n'

    from genie.libs.parser.iosxe.show_platform import ShowInventory as ShowInventory dev_obj = ShowInventory('?') parsed_output = dev_obj.cli(output = raw_data) import pprint pp = pprint.PrettyPrinter(indent=2) pp.pprint(parsed_output) { 'slot': { '1': { 'lc': { 'WS-X6708-10GE': { 'descr': 'WS-X6708-10GE CEF720 8 ' 'port 10GE with DFC ' 'Rev. 2.5', 'name': 'module 1', 'pid': 'WS-X6708-10GE', 'sn': 'SAL14028GKA', 'vid': 'V12'}}}, '2': { 'lc': { 'WS-X6748-GE-TX': { 'descr': 'WS-X6748-GE-TX CEF720 ' '48 port 10/100/1000mb ' 'Ethernet Rev. 3.4', 'name': 'module 2', 'pid': 'WS-X6748-GE-TX', 'sn': 'SAL1411CUS6', 'vid': 'V04'}}}, '3': { 'lc': { 'WS-X6724-SFP': { 'descr': 'WS-X6724-SFP CEF720 24 ' 'port 1000mb SFP Rev. ' '4.4', 'name': 'module 3', 'pid': 'WS-X6724-SFP', 'sn': 'SAL1430P5Y4', 'vid': 'V07'}}}, '4': { 'lc': { 'WS-X6748-GE-TX': { 'descr': 'WS-X6748-GE-TX CEF720 ' '48 port 10/100/1000mb ' 'Ethernet Rev. 4.2', 'name': 'module 4', 'pid': 'WS-X6748-GE-TX', 'sn': 'SAL1641PAG0', 'vid': 'V05'}}}, '5': { 'other': { 'RSP720-3C-GE': { 'descr': 'RSP720-3C-GE 2 ports ' 'Route Switch ' 'Processor 720 Rev. ' '5.9', 'name': 'module 5', 'pid': 'RSP720-3C-GE', 'sn': 'JAE14160K9H', 'vid': 'V09'}}}, '6': { 'other': { 'RSP720-3C-GE': { 'descr': 'RSP720-3C-GE 2 ports ' 'Route Switch ' 'Processor 720 Rev. ' '5.9', 'name': 'module 6', 'pid': 'RSP720-3C-GE', 'sn': 'JAE14270GMC', 'vid': 'V09'}}}}}

    /Alexander

    On Fri, Nov 22, 2019 at 3:25 AM THAI NGUYEN wrote:

    Hello https://github.com/nettworker , I just tried the output that you provided with XE parser. It worked fine. Can you please try again with IOSXE instead of IOS and let me know?

    Thanks, --Thai.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CiscoTestAutomation/genieparser/issues/8?email_source=notifications&email_token=AD6SBSSJF62B7RWGUQAWPV3QU4RGNA5CNFSM4G2U22SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE4DRKY#issuecomment-557332651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6SBSRX3LRWKDE6QQMS6JLQU4RGNANCNFSM4G2U22SA .

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Hello , Thanks for pointed that out. We'll take a closer look and fix it.

    --Thai.

    点赞 评论 复制链接分享
  • weixin_39628070 weixin_39628070 3月前

    Hello ,

    We fixed the issue and genie package v20.1 has been released with the fix. Could you please run the following command and try again to see if it works?

    pip install genie.libs.parser --upgrade --pre

    Thanks, Irene

    点赞 评论 复制链接分享
  • weixin_39782500 weixin_39782500 3月前

    Thanks for bringing this to our attention. We've fixed the issue observed and it will be released on PyPI/GitHub on Monday

    点赞 评论 复制链接分享
  • weixin_39564527 weixin_39564527 3月前

    Thanks
    Does this fix for across other parser libraries? Seeing the same issue on other profile commands as well. Do you want me to open separate issues for that, or a general message of which ones are failing as well? For example 'vrf' fails as well.

    Profile all devices and save to file Profile the system for "vrf" on devices "uut"

    点赞 评论 复制链接分享
  • weixin_39565390 weixin_39565390 3月前

    Hi ,

    The best would be if you can provide us the device output and error you are seeing, and we will tackle it. Just like above, but for all the commands you are seeing an issue. We will get them fixed.

    You can send us your device output and error at pyats-support-ext.com so they aren't shared publicly if you prefer.

    点赞 评论 复制链接分享
  • weixin_39564527 weixin_39564527 3月前

    Awesome, I'll get some going and sent to the email above.

    Thanks

    点赞 评论 复制链接分享
  • weixin_39782500 weixin_39782500 3月前

    Hi ,

    The fix for this issue has been released. Please upgrade your package or pull the latest code if in develop mode.

    点赞 评论 复制链接分享
  • weixin_39564527 weixin_39564527 3月前

    Thanks, I manually copied over the libs. Is it suppose to go to version 19 when doing a pip install --upgrade genie or pip install --upgrade genie.parser

    I still get version 3.1.17

    genie.libs.parser 3.1.17.

    I can confirm that version 19 works and no errors.

    点赞 评论 复制链接分享
  • weixin_39565390 weixin_39565390 3月前

    Hi , we faced some delay with the release process; our released server had some issues. They will be fixed tonight and we will do the external release by tomorrow morning.

    Will update here when its ready.

    Yes they will switch to 19.x once updated;

    点赞 评论 复制链接分享
  • weixin_39565390 weixin_39565390 3月前
    • Just to let you know its been officially released.

    Please pip upgrade and you should see all the new 19.x version

    点赞 评论 复制链接分享
  • weixin_39687189 weixin_39687189 3月前

    Hi guys!

    I just tried to use the following code:

    from genie.libs.parser.ios.show_platform import ShowInventory as ShowInventory raw_data = "show inventory output ..." dev_obj = ShowInventory('-') parsed_output = dev_obj.cli(output = raw_data)

    and have got the same type of error as described before: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/genie/libs/parser/ios/show_platform.py", line 228, in cli subslot_dict = slot_dict\ UnboundLocalError: local variable 'slot_dict' referenced before assignment

    I do the same things with the following parsers with no errors: from genie.libs.parser.iosxe.show_platform import ShowInventory as ShowInventory from genie.libs.parser.iosxr.show_platform import ShowInventory as ShowInventory from genie.libs.parser.nxos.show_platform import ShowInventory as ShowInventory

    pip3 list | grep genie.libs genie.libs.conf 19.9
    genie.libs.filetransferutils 19.9
    genie.libs.ops 19.9
    genie.libs.parser 19.9.1b6
    genie.libs.sdk 19.9.1
    genie.libs.telemetry 19.9

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Hi , we are communicating thru emails for more info.

    Thanks, --Thai.

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Hi ,

    To further troubleshoot the issue, can you please provide the actual output from the device?

    Please send it to pyats-support-ext.com.

    Thanks, --Thai.

    点赞 评论 复制链接分享
  • weixin_39687189 weixin_39687189 3月前

    H!

    See raw output for "show inventory" command on IOS device (Cisco 7600) and for NX-OS device (Nexus 7000) in attach

    WBR, /Alexander

    On Thu, Nov 7, 2019 at 3:19 AM THAI NGUYEN wrote:

    Hi https://github.com/nettworker ,

    To further troubleshoot the issue, can you please provide the actual output from the device?

    Please send it to pyats-support-ext.com.

    Thanks, --Thai.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CiscoTestAutomation/genieparser/issues/8?email_source=notifications&email_token=AD6SBSWL73ESUQPYDLLLH73QSNNJHA5CNFSM4G2U22SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDIOO7I#issuecomment-550561661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6SBSSJY4AN4G4TMBG73QDQSNNJHANCNFSM4G2U22SA .

    Router# show inventory

    NAME: "CISCO7606-S", DESCR: "Cisco Systems Cisco 7600 6-slot Chassis System" PID: CISCO7606-S , VID: V02, SN: FOX1410G7D0

    NAME: "CLK-7600 1", DESCR: "OSR-7600 Clock FRU 1" PID: CLK-7600 , VID: , SN: NWG140305D7

    NAME: "CLK-7600 2", DESCR: "OSR-7600 Clock FRU 2" PID: CLK-7600 , VID: , SN: NWG140305D7

    NAME: "module 1", DESCR: "WS-X6708-10GE CEF720 8 port 10GE with DFC Rev. 2.5" PID: WS-X6708-10GE , VID: V12, SN: SAL14028GKA

    NAME: "switching engine sub-module of 1", DESCR: "WS-F6700-DFC3CXL Distributed Forwarding Card 3 Rev. 1.10" PID: WS-F6700-DFC3CXL , VID: V04, SN: SAL1416G260

    NAME: "Transceiver Te1/1", DESCR: "Transceiver 10Gbase-SR Te1/1" PID: X2-10GB-SR , VID: V04 , SN: ONT140302N5

    NAME: "Transceiver Te1/2", DESCR: "Transceiver 10Gbase-SR Te1/2" PID: X2-10GB-SR , VID: V04 , SN: ONT140702KM

    NAME: "Transceiver Te1/3", DESCR: "Transceiver 10Gbase-LR Te1/3" PID: X2-10GB-LR , VID: V05 , SN: AGA1631X25J

    NAME: "Transceiver Te1/4", DESCR: "Transceiver 10Gbase-LR Te1/4" PID: X2-10GB-LR , VID: V04 , SN: AGA1406XL1Z

    NAME: "Transceiver Te1/5", DESCR: "Transceiver 10Gbase-LR Te1/5" PID: X2-10GB-LR , VID: V03 , SN: XX96L013

    NAME: "Transceiver Te1/6", DESCR: "Transceiver 10Gbase-LR Te1/6" PID: X2-10GB-LR , VID: V05 , SN: AGA1631X1M0

    NAME: "Transceiver Te1/7", DESCR: "Transceiver 10Gbase-LR Te1/7" PID: X2-10GB-LR , VID: V04 , SN: AGA1404XBQX

    NAME: "Transceiver Te1/8", DESCR: "Transceiver 10Gbase-LR Te1/8" PID: X2-10GB-LR , VID: V04 , SN: AGA1407XQY2

    NAME: "module 2", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 3.4" PID: WS-X6748-GE-TX , VID: V04, SN: SAL1411CUS6

    NAME: "switching engine sub-module of 2", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" PID: WS-F6700-CFC , VID: V06, SN: SAL1413E7Y4

    NAME: "module 3", DESCR: "WS-X6724-SFP CEF720 24 port 1000mb SFP Rev. 4.4" PID: WS-X6724-SFP , VID: V07, SN: SAL1430P5Y4

    NAME: "switching engine sub-module of 3", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" PID: WS-F6700-CFC , VID: V06, SN: SAL1430NWPY

    NAME: "Transceiver Gi3/1", DESCR: "Transceiver 1000BaseLH Gi3/1" PID: GLC-LH-SMD , VID: 002 , SN: AVJ18373BWG

    NAME: "Transceiver Gi3/2", DESCR: "Transceiver 1000BaseT Gi3/2" PID: N/A , VID: E , SN: MTC184007T2

    NAME: "Transceiver Gi3/7", DESCR: "Transceiver 1000BaseLH Gi3/7" PID: N/A , VID: A0 , SN: SA1F610142

    NAME: "Transceiver Gi3/10", DESCR: "Transceiver 1000BaseLH Gi3/10" PID: SFP-GE-L , VID: A , SN: SPC161903KB

    NAME: "Transceiver Gi3/11", DESCR: "Transceiver 1000BaseLH Gi3/11" PID: SFP-GE-L , VID: A , SN: SPC161903KC

    NAME: "module 4", DESCR: "WS-X6748-GE-TX CEF720 48 port 10/100/1000mb Ethernet Rev. 4.2" PID: WS-X6748-GE-TX , VID: V05, SN: SAL1641PAG0

    NAME: "switching engine sub-module of 4", DESCR: "WS-F6700-CFC Centralized Forwarding Card Rev. 4.1" PID: WS-F6700-CFC , VID: V06, SN: SAL1638NCMG

    NAME: "module 5", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9" PID: RSP720-3C-GE , VID: V09, SN: JAE14160K9H

    NAME: "msfc sub-module of 5", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5" PID: 7600-MSFC4 , VID: 000, SN: JAE141601VE

    NAME: "switching engine sub-module of 5", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2" PID: 7600-PFC3C , VID: 000, SN: JAE14150L5S

    NAME: "Transceiver Gi5/1", DESCR: "Transceiver 1000BaseLH Gi5/1" PID: N/A , VID: A0 , SN: H11L057

    NAME: "module 6", DESCR: "RSP720-3C-GE 2 ports Route Switch Processor 720 Rev. 5.9" PID: RSP720-3C-GE , VID: V09, SN: JAE14270GMC

    NAME: "msfc sub-module of 6", DESCR: "7600-MSFC4 C7600 MSFC4 Daughterboard Rev. 1.5" PID: 7600-MSFC4 , VID: 000, SN: JAE142709J2

    NAME: "switching engine sub-module of 6", DESCR: "7600-PFC3C Policy Feature Card 3 Rev. 1.2" PID: 7600-PFC3C , VID: 000, SN: JAE14270H9A

    NAME: "FAN-MOD-6SHS 1", DESCR: "High Speed Fan Module for CISCO7606-S 1" PID: FAN-MOD-6SHS , VID: V01, SN: DCH1411002X

    NAME: "PS 1 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 1" PID: PWR-2700-DC , VID: V03, SN: APS141400NV

    NAME: "PS 2 PWR-2700-DC", DESCR: "DC power supply, 2700 watt 2" PID: PWR-2700-DC , VID: V03, SN: APS141400NK

    NAME: "Chassis", DESCR: "Nexus7000 C7004 (4 Slot) Chassis "
    PID: N7K-C7004 , VID: V01 , SN: JPG20240041

    NAME: "Slot 1", DESCR: "Supervisor Module-2"
    PID: N7K-SUP2E , VID: V03 , SN: JAE20300C5P

    NAME: "Slot 3", DESCR: "1/10 Gbps Ethernet Module"
    PID: N7K-F348XP-25 , VID: V01 , SN: JAE203006BU

    NAME: "Slot 33", DESCR: "Nexus7000 C7004 (4 Slot) Chassis Power Supply" PID: N7K-AC-3KW , VID: V04 , SN: ART1945701A

    NAME: "Slot 34", DESCR: "Nexus7000 C7004 (4 Slot) Chassis Power Supply" PID: N7K-AC-3KW , VID: V04 , SN: ART1950705D

    NAME: "Slot 35", DESCR: "Nexus7000 C7004 (4 Slot) Chassis Power Supply" PID: N7K-AC-3KW , VID: V04 , SN: ART1950705E

    NAME: "Slot 36", DESCR: "Nexus7000 C7004 (4 Slot) Chassis Power Supply" PID: N7K-AC-3KW , VID: V04 , SN: ART19507044

    NAME: "Slot 37", DESCR: "Nexus7000 C7004 (4 Slot) Chassis Fan Module" PID: N7K-C7004-FAN , VID: V01 , SN: JAE202102E9

    点赞 评论 复制链接分享
  • weixin_39992831 weixin_39992831 3月前

    Thanks for the info. I will take a look and let you know once the issue is fixed.

    --Thai.

    点赞 评论 复制链接分享