cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
778
Views
0
Helpful
4
Replies

pyATS - Not capturing all output

toeknee2120
Level 1
Level 1

I'm running "show run interface ethX/X" on multiple interfaces using pyATS on a Nexus9000 C9508, and the only fields in the response for each interface is description and shutdown.

 

 

 

# command
response = device.parse("show run interface eth1/1")

# example response
{"Ethernet1/1": {"description": "somedesc", "shutdown": False}}

 

 

 

But, running the same command on the device shows more information, like ip or inherit commands.

Any ideas?

1 Accepted Solution

Accepted Solutions

Try and use execute, instead of parse. If i recall, parse() provides a structured, ready-to-use dictionary, while execute() gives you raw text (this requires manual processing fyi)
 
The fact you see that learn() works correctly suggests this is a parsing/library-specific issue rather than a device configuration problem.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

4 Replies 4

Try and use execute, instead of parse. If i recall, parse() provides a structured, ready-to-use dictionary, while execute() gives you raw text (this requires manual processing fyi)
 
The fact you see that learn() works correctly suggests this is a parsing/library-specific issue rather than a device configuration problem.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Yes, execute shows all the expected output.

I was using parse because it was listed as an available parser: https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/#/parsers/show%2520running-config%2520interface%2520%257Binterface%257D

I'm not sure why it's not working.

Thanks.

Glad it’s working, might be worth contacting the pyats team or putting an issue on the code repo. Very strange and the parser might need to be looked at for this model. I popped the question in the webex team space for pyats.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Takashi Higashimura
Cisco Employee
Cisco Employee

If you can share the output that you are trying to parse in public, please open an issue via https://github.com/CiscoTestAutomation/genieparser/issues. If the output contains sensitive information, please send an email with the output to pyats-support-ext@cisco.com.