CiscoDevNet / ydk-py

This project has been archived and the repository will no longer be updated. Python SDK generated from YANG data models.

Home Page:http://ydk.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API to return raw xml data

madhusj13 opened this issue · comments

Can we have an API to get raw xml data, when I try to run ydk for getting oper data from the router ?

There are multiple instances where xml output returned by the router is in-correct. Consequently, ydk returns 'YPYModelError: 0 already in list'. In such instances, it will be good to get the xml output in raw format.

Data validation is a feature. One of the items being tracked is enhancing the error message so it's easier to identify the path to the erroneous data. Regardless, you can use logging to inspect the raw XML. The samples apps in https://github.com/CiscoDevNet/ydk-py-samples make use of logging. In the future, please file issues in https://github.com/CiscoDevNet/ydk-gen This repo is auto-generated. Thanks.

It may be a valid approach to include extra data (like invalid XML) in the python exception. see for example: http://legacy.python.org/dev/peps/pep-0473/. Maybe we should reopen this issue on the ydk-gen repo?