11-28-2019 10:42 PM
Hi pyATS community,
just to let you know - or maybe I did anything wrong ... There are errors with the genie parser "show inventory" on some IOS devices.
Steps to reproduce the problem
devices: myDevice: connections: ssh: ip: 192.0.2.1 protocol: ssh os: ios series: Cisco Catalyst 6880-X-LE Switch
type: distribution
genie parse "show inventory" --testbed-file lab.yaml --devices myDeviceError:
Issue with the parser show inventory Traceback (most recent call last): File "src/genie/cli/commands/parser.py", line 289, in genie.cli.commands.parser.ParserCommand.parse File "src/genie/conf/base/device.py", line 529, in genie.conf.base.device.Device.parse File "src/genie/metaparser/_metaparser.py", line 302, in genie.metaparser._metaparser.MetaParser.parse File "src/genie/metaparser/_metaparser.py", line 284, in genie.metaparser._metaparser.MetaParser.parse File "src/genie/metaparser/util/schemaengine.py", line 398, in genie.metaparser.util.schemaengine.Schema.validate genie.metaparser.util.exceptions.SchemaMissingKeyError: Missing keys: [['slot']]
Other parsers with the same device work as expected. Example:
genie parse "show version" --testbed-file lab.yaml --devices myDevice { "version": { "chassis": "C6880-X-LE", "chassis_sn": "XXXXXXXXXXXXXXXXXXXX", "curr_config_register": "0x2102", "hostname": "myDevice", "image_id": "c6880x-IPSERVICESK9-M", "image_type": "production image", "last_reload_reason": "power-on", "main_mem": "2997247", "number_of_intfs": { "Ten Gigabit Ethernet": "16", "Virtual Ethernet": "3" }, "os": "IOS", "platform": "c6880x", "processor_type": " Intel(R) Core(TM) i3- CPU @ 2.00GHz ", "rom": "System Bootstrap, Version 15.1(02)SY01 [ Rel 1.1], RELEASE SOFTWARE", "rtr_type": "C6880-X-LE", "system_image": "bootdisk:/c6880x-ipservicesk9-mz.SPA.152-1.SY4.bin", "system_restarted_at": "17:47:43 MESZ Tue Aug 22 2017", "uptime": "2 years, 14 weeks, 14 hours, 13 minutes", "uptime_this_cp": "2 years, 14 weeks, 13 hours, 8 minutes", "version": "15.2(1)SY4", "version_short": "15.2" } }
Im running the latest release (19.11)
pip list | grep genie genie 19.11
Anything I did wrong here?
Best regards
Johannes
Solved! Go to Solution.
03-09-2020 04:10 AM
Hmm - If you can Johannes, upgrade your pyATS/Genie to the latest 20.2 edition with the command "pyats version update" and try parsing 'show inventory' again.
03-09-2020 04:08 AM
Hi Johannes,
Hmm that is not good at all. Your set up is correct though. I can see from the documentation that 'show inventory' can be parsed with iOS devices.
The error in particular looks like its complaining that "slot" is not a field it can find and therefore falls apart.
Can you provide the CLI output of "show inventory" and I can check this one out?
I've attached a screenshot of what the desired output should look like in case you wanted to see what it should show :)
03-09-2020 04:10 AM
Hmm - If you can Johannes, upgrade your pyATS/Genie to the latest 20.2 edition with the command "pyats version update" and try parsing 'show inventory' again.
03-09-2020 04:58 AM
Hi LanDownUnda :)
thanks for the reply
I upgraded pyATS and genie ... however the suggested command "pyats version update" does not work
$ pyats version update Usage: pyats version [options] Description: Display the installed pyATS version, including all individual components. Version Options: --outdated Check PyPI for package upgrades --include [ [ ...]] Other packages to include & display General Options: -h, --help Show help -v, --verbose Give more output, additive up to 3 times. -q, --quiet Give less output, additive up to 3 times, corresponding to WARNING, ERROR, and CRITICAL logging levels
I upgraded the packages using pip.
With the new version, the "show inventory" parser for the Cat6k works as expected.
I didn't test it again since then with the new version ... :) But good to know it works now and it was not some usage error on my side (which could have been the case, because I'm brand new to pyATS/Genie).
Anyway - thanks for letting me know!!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide