Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected exception when getting empty config #305

Closed
111pontes opened this issue Nov 19, 2016 · 0 comments
Closed

Unexpected exception when getting empty config #305

111pontes opened this issue Nov 19, 2016 · 0 comments
Labels

Comments

@111pontes
Copy link
Collaborator

Using NETCONF service, get_config operation throws an unexpected exception if there's no configuration data on the device:

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9ca86d33-1e92-43e9-8302-e7eb7b649c14">
  <get-config>
    <source>
      <running></running>
    </source>
    <filter>
      <ip-domain xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ip-domain-cfg"/>
    </filter>
  </get-config>
</rpc>

2016-11-18 16:28:18,908 - ydk.services.NetconfService - INFO - Netconf operation completed
Traceback (most recent call last):
  File "./nc-get-config-xr-ip-domain-cfg-99-ydk.py", line 79, in <module>
    ip_domain = netconf.get_config(provider, Datastore.running, ip_domain)
  File "/usr/local/lib/python2.7/dist-packages/ydk/services/netconf_service.py", line 311, in get_config
    return provider.decode(payload_convert(payload), None)
  File "/usr/local/lib/python2.7/dist-packages/ydk/services/netconf_service.py", line 469, in payload_convert
    return etree.tostring(chchs[0], pretty_print=True, encoding='utf-8').decode('utf-8')
IndexError: list index out of range
@111pontes 111pontes added the bug label Nov 21, 2016
@ghost ghost mentioned this issue Jan 30, 2017
@ghost ghost closed this as completed Jan 31, 2017
@ghost ghost mentioned this issue Jan 31, 2017
ghost pushed a commit that referenced this issue Jan 31, 2017
* Issue #346
 * #208
 * #272
 * #300
 * #294
 * #318
 * #303 (only for bits)
 * #323
 * #305
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant