InsightSSG / Net-Manage

Net-Manage is a repository for storing re-usable functions and playbooks for automation.
MIT License
4 stars 2 forks source link

IOS inventory collector fails on virtual devices #481

Closed ascension2020 closed 11 months ago

ascension2020 commented 11 months ago

`--------------------------------------------------------------------------- IndexError Traceback (most recent call last) File :51

File ~/source/repos/InsightSSG/Net-Manage/netmanage/run_collectors.py:375, in collect(ansible_os, collector, hostgroup, timestamp) 368 result = cac.inventory(asa_devices_username, 369 asa_devices_password, 370 hostgroup, 371 play_path, 372 private_data_dir) 374 if ansible_os == 'cisco.ios.ios': --> 375 result = cic.inventory(ios_devices_username, 376 ios_devices_password, 377 hostgroup, 378 play_path, 379 private_data_dir) 381 if ansible_os == 'cisco.nxos.nxos': 382 result = cnc.nxos_get_inventory(nxos_devices_username, 383 nxos_devices_password, 384 hostgroup, 385 play_path, 386 private_data_dir)

File ~/source/repos/InsightSSG/Net-Manage/netmanage/collectors/cisco_ios_collectors.py:195, in inventory(username, password, host_group, play_path, private_data_dir) 189 runner = ansible_runner.run(private_data_dir=private_data_dir, 190 playbook=playbook, 191 extravars=extravars, 192 suppress_env_files=True) 194 # Parse results into df --> 195 return parser.ios_parse_inventory(runner)

File ~/source/repos/InsightSSG/Net-Manage/netmanage/parsers/cisco_ios_parsers.py:691, in ios_parse_inventory(runner) 686 name_desc = data[i].split(", DESCR: ") 687 df_data['name'].append( 688 name_desc[0].replace('NAME: "', ''). 689 replace('"', '').strip()) 690 df_data['description'].append( --> 691 name_desc[1].replace('"', '').strip()) 693 # Split the second line to extract PID, VID and SN 694 pid_vid_sn = data[i+1].split(", ")

IndexError: list index out of range`