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

IOS-XE ydk.errors.YPYModelError: Invalid value "ianaift:ethernetCsmacd" in "type" element #627

Closed
dmfigol opened this issue Nov 14, 2017 · 1 comment
Labels

Comments

@dmfigol
Copy link

dmfigol commented Nov 14, 2017

Current Behavior

Python script crashes when I operate with ietf_interfaces yang model

Expected Behavior

It should not crash with the valid RPC reply.

Steps to Reproduce

Take the device running IOS-XE 16.6.1 and run the following script using ydk-models-cisco-ios-xe version 16.6.1.post1

Script

import logging
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.ietf import ietf_interfaces
from ydk.models.openconfig import openconfig_interfaces

HOST = "csr-16.6-gs"
USERNAME = "cisco"
PASSWORD = "cisco"

def main():
    log = logging.getLogger('ydk')
    log.setLevel(logging.INFO)
    handler = logging.StreamHandler()
    log.addHandler(handler)

    provider = NetconfServiceProvider(address=HOST, username=USERNAME, password=PASSWORD)

    crud = CRUDService()
    query = ietf_interfaces.Interfaces()
    # query = openconfig_interfaces.Interfaces()
    interfaces = crud.read(provider, query)

if __name__ == '__main__':
    main()


Logs

Path where models are to be downloaded: /Users/dmfigol/.ydk/csr-16.6-gs:830
Connected to csr-16.6-gs on port 830 using ssh with timeout of -1
Executing CRUD read operation
=============Generating payload to send to device=============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter><interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"/></filter>
</get>
</rpc>


=============Reply payload received from device=============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <data>
    <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>GigabitEthernet1</name>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
        <enabled>true</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <address>
            <ip>10.1.1.1</ip>
            <netmask>255.255.255.192</netmask>
          </address>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
      <interface>
        <name>GigabitEthernet2</name>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
        <enabled>false</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <address>
            <ip>192.168.0.13</ip>
            <netmask>255.255.255.0</netmask>
          </address>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
      <interface>
        <name>GigabitEthernet3</name>
        <description>test</description>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
        <enabled>false</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <address>
            <ip>100.100.100.100</ip>
            <netmask>255.255.255.0</netmask>
          </address>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
      <interface>
        <name>Loopback0</name>
        <description>Just a loopback</description>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
        <enabled>true</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <address>
            <ip>172.1.2.3</ip>
            <netmask>255.255.255.255</netmask>
          </address>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
      <interface>
        <name>Loopback1000</name>
        <description>Loopback created using RESTCONF/IETF YANG</description>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
        <enabled>true</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <address>
            <ip>172.1.2.10</ip>
            <netmask>255.255.255.255</netmask>
          </address>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
      <interface>
        <name>Loopback2449</name>
        <description>Created by Dmitry Figol</description>
        <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
        <enabled>true</enabled>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      </interface>
    </interfaces>
  </data>
</rpc-reply>



Libyang ERROR: Invalid value "ianaift:ethernetCsmacd" in "type" element. Path: '/ietf-interfaces:interfaces/interface[name='GigabitEthernet1']/type'
Traceback (most recent call last):
  File "test_ydk.py", line 22, in <module>
    main()
  File "test_ydk.py", line 19, in main
    interfaces = crud.read(provider, query)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 112, in helper
    return func(self, provider, entity, *args, **kwargs)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/services/crud_service.py", line 35, in read
    return self._crud.read(provider, read_filter)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
    exec("raise exc from None")
  File "<string>", line 1, in <module>
ydk.errors.YPYModelError:  Invalid value "ianaift:ethernetCsmacd" in "type" element. Path: /ietf-interfaces:interfaces/interface[name='GigabitEthernet1']/type
Disconnected from device

System Information

Python 3.6.3, macOS High Sierra, x86_64
Tested on CSR1000v running 16.6.1

➜  pip3 freeze | grep ydk
ydk==0.6.2
ydk-models-cisco-ios-xe==16.6.1.post1
ydk-models-ietf==0.1.4
ydk-models-openconfig==0.1.4

Additional details

Similar happens when openconfig_interfaces.Interfaces() is used (uncomment the line in code).
Result:

➜  python3 test_ydk.py
Path where models are to be downloaded: /Users/dmfigol/.ydk/csr-16.6-gs:830
Connected to csr-16.6-gs on port 830 using ssh with timeout of -1
Executing CRUD read operation
=============Generating payload to send to device=============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter><interfaces xmlns="http://openconfig.net/yang/interfaces"/></filter>
</get>
</rpc>


=============Reply payload received from device=============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10">
  <data>
    <interfaces xmlns="http://openconfig.net/yang/interfaces">
      <interface>
        <name>GigabitEthernet1</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet1</name>
          <enabled>true</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet1</name>
          <enabled>true</enabled>
          <ifindex>0</ifindex>
          <admin-status>UP</admin-status>
          <oper-status>UP</oper-status>
          <last-change>2017-11-12T15:14:03.000377+00:00</last-change>
          <counters>
            <in-octets>560261022</in-octets>
            <in-unicast-pkts>1110562</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>0</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>77804785</out-octets>
            <out-unicast-pkts>1254467</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:04.000153+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>GigabitEthernet1</name>
              <enabled>true</enabled>
            </config>
            <state>
              <index>0</index>
              <name>GigabitEthernet1.0</name>
              <enabled>true</enabled>
              <admin-status>UP</admin-status>
              <oper-status>UP</oper-status>
              <last-change>2017-11-12T15:14:03.000377+00:00</last-change>
              <counters>
                <in-octets>560261022</in-octets>
                <in-unicast-pkts>1110562</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>0</in-errors>
                <out-octets>77804785</out-octets>
                <out-unicast-pkts>1254467</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:04.000153+00:00</last-clear>
              </counters>
            </state>
            <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
              <addresses>
                <address>
                  <ip>10.1.1.1</ip>
                  <config>
                    <ip>10.1.1.1.</ip>
                    <prefix-length>26</prefix-length>
                  </config>
                  <state>
                    <ip>10.1.1.1</ip>
                    <prefix-length>26</prefix-length>
                  </state>
                </address>
              </addresses>
            </ipv4>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
        <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
          <config>
            <auto-negotiate>true</auto-negotiate>
          </config>
        </ethernet>
      </interface>
      <interface>
        <name>GigabitEthernet2</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet2</name>
          <enabled>false</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet2</name>
          <enabled>false</enabled>
          <ifindex>0</ifindex>
          <admin-status>DOWN</admin-status>
          <oper-status>DOWN</oper-status>
          <last-change>2017-11-12T15:14:14.000902+00:00</last-change>
          <counters>
            <in-octets>82225</in-octets>
            <in-unicast-pkts>1032</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>69840</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>0</out-octets>
            <out-unicast-pkts>0</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:03.000821+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>GigabitEthernet2</name>
              <enabled>false</enabled>
            </config>
            <state>
              <index>0</index>
              <name>GigabitEthernet2.0</name>
              <enabled>false</enabled>
              <admin-status>DOWN</admin-status>
              <oper-status>DOWN</oper-status>
              <last-change>2017-11-12T15:14:14.000902+00:00</last-change>
              <counters>
                <in-octets>82225</in-octets>
                <in-unicast-pkts>1032</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>69840</in-errors>
                <out-octets>0</out-octets>
                <out-unicast-pkts>0</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:03.000821+00:00</last-clear>
              </counters>
            </state>
            <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
              <addresses>
                <address>
                  <ip>192.168.0.13</ip>
                  <config>
                    <ip>192.168.0.13</ip>
                    <prefix-length>24</prefix-length>
                  </config>
                  <state>
                    <ip>192.168.0.13</ip>
                    <prefix-length>24</prefix-length>
                  </state>
                </address>
              </addresses>
            </ipv4>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
        <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
          <config>
            <auto-negotiate>true</auto-negotiate>
          </config>
        </ethernet>
      </interface>
      <interface>
        <name>GigabitEthernet3</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet3</name>
          <description>test</description>
          <enabled>false</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
          <name>GigabitEthernet3</name>
          <description>test</description>
          <enabled>false</enabled>
          <ifindex>0</ifindex>
          <admin-status>DOWN</admin-status>
          <oper-status>DOWN</oper-status>
          <last-change>2017-11-12T15:14:14.000927+00:00</last-change>
          <counters>
            <in-octets>25838</in-octets>
            <in-unicast-pkts>353</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>0</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>0</out-octets>
            <out-unicast-pkts>0</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:03.000855+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>GigabitEthernet3</name>
              <description>test</description>
              <enabled>false</enabled>
            </config>
            <state>
              <index>0</index>
              <name>GigabitEthernet3.0</name>
              <description>test</description>
              <enabled>false</enabled>
              <admin-status>DOWN</admin-status>
              <oper-status>DOWN</oper-status>
              <last-change>2017-11-12T15:14:14.000927+00:00</last-change>
              <counters>
                <in-octets>25838</in-octets>
                <in-unicast-pkts>353</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>0</in-errors>
                <out-octets>0</out-octets>
                <out-unicast-pkts>0</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:03.000855+00:00</last-clear>
              </counters>
            </state>
            <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
              <addresses>
                <address>
                  <ip>100.100.100.100</ip>
                  <config>
                    <ip>100.100.100.100</ip>
                    <prefix-length>24</prefix-length>
                  </config>
                  <state>
                    <ip>100.100.100.100</ip>
                    <prefix-length>24</prefix-length>
                  </state>
                </address>
              </addresses>
            </ipv4>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
        <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
          <config>
            <auto-negotiate>true</auto-negotiate>
          </config>
        </ethernet>
      </interface>
      <interface>
        <name>Loopback0</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback0</name>
          <description>Just a loopback</description>
          <enabled>true</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback0</name>
          <description>Just a loopback</description>
          <enabled>true</enabled>
          <ifindex>0</ifindex>
          <admin-status>UP</admin-status>
          <oper-status>UP</oper-status>
          <last-change>2017-11-12T15:14:10.000754+00:00</last-change>
          <counters>
            <in-octets>0</in-octets>
            <in-unicast-pkts>0</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>0</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>0</out-octets>
            <out-unicast-pkts>0</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:03.000349+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>Loopback0</name>
              <description>Just a loopback</description>
              <enabled>true</enabled>
            </config>
            <state>
              <index>0</index>
              <name>Loopback0.0</name>
              <description>Just a loopback</description>
              <enabled>true</enabled>
              <admin-status>UP</admin-status>
              <oper-status>UP</oper-status>
              <last-change>2017-11-12T15:14:10.000754+00:00</last-change>
              <counters>
                <in-octets>0</in-octets>
                <in-unicast-pkts>0</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>0</in-errors>
                <out-octets>0</out-octets>
                <out-unicast-pkts>0</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:03.000349+00:00</last-clear>
              </counters>
            </state>
            <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
              <addresses>
                <address>
                  <ip>172.1.2.3</ip>
                  <config>
                    <ip>172.1.2.3</ip>
                    <prefix-length>32</prefix-length>
                  </config>
                  <state>
                    <ip>172.1.2.3</ip>
                    <prefix-length>32</prefix-length>
                  </state>
                </address>
              </addresses>
            </ipv4>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
      </interface>
      <interface>
        <name>Loopback1000</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback1000</name>
          <description>Loopback created using RESTCONF/IETF YANG</description>
          <enabled>true</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback1000</name>
          <description>Loopback created using RESTCONF/IETF YANG</description>
          <enabled>true</enabled>
          <ifindex>0</ifindex>
          <admin-status>UP</admin-status>
          <oper-status>UP</oper-status>
          <last-change>2017-11-12T15:14:11.000219+00:00</last-change>
          <counters>
            <in-octets>0</in-octets>
            <in-unicast-pkts>0</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>0</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>0</out-octets>
            <out-unicast-pkts>0</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:03.000699+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>Loopback1000</name>
              <description>Loopback created using RESTCONF/IETF YANG</description>
              <enabled>true</enabled>
            </config>
            <state>
              <index>0</index>
              <name>Loopback1000.0</name>
              <description>Loopback created using RESTCONF/IETF YANG</description>
              <enabled>true</enabled>
              <admin-status>UP</admin-status>
              <oper-status>UP</oper-status>
              <last-change>2017-11-12T15:14:11.000219+00:00</last-change>
              <counters>
                <in-octets>0</in-octets>
                <in-unicast-pkts>0</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>0</in-errors>
                <out-octets>0</out-octets>
                <out-unicast-pkts>0</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:03.000699+00:00</last-clear>
              </counters>
            </state>
            <ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
              <addresses>
                <address>
                  <ip>172.1.2.10</ip>
                  <config>
                    <ip>172.1.2.10</ip>
                    <prefix-length>32</prefix-length>
                  </config>
                  <state>
                    <ip>172.1.2.10</ip>
                    <prefix-length>32</prefix-length>
                  </state>
                </address>
              </addresses>
            </ipv4>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
      </interface>
      <interface>
        <name>Loopback2449</name>
        <config>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback2449</name>
          <description>Created by Dmitry Figol</description>
          <enabled>true</enabled>
        </config>
        <state>
          <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
          <name>Loopback2449</name>
          <description>Created by Dmitry Figol</description>
          <enabled>true</enabled>
          <ifindex>0</ifindex>
          <admin-status>UP</admin-status>
          <oper-status>UP</oper-status>
          <last-change>2017-11-12T15:14:11.00009+00:00</last-change>
          <counters>
            <in-octets>0</in-octets>
            <in-unicast-pkts>0</in-unicast-pkts>
            <in-broadcast-pkts>0</in-broadcast-pkts>
            <in-multicast-pkts>0</in-multicast-pkts>
            <in-discards>0</in-discards>
            <in-errors>0</in-errors>
            <in-unknown-protos>0</in-unknown-protos>
            <out-octets>0</out-octets>
            <out-unicast-pkts>0</out-unicast-pkts>
            <out-broadcast-pkts>0</out-broadcast-pkts>
            <out-multicast-pkts>0</out-multicast-pkts>
            <out-discards>0</out-discards>
            <out-errors>0</out-errors>
            <last-clear>2017-11-12T15:08:03.000434+00:00</last-clear>
          </counters>
        </state>
        <subinterfaces>
          <subinterface>
            <index>0</index>
            <config>
              <index>0</index>
              <name>Loopback2449</name>
              <description>Created by Dmitry Figol</description>
              <enabled>true</enabled>
            </config>
            <state>
              <index>0</index>
              <name>Loopback2449.0</name>
              <description>Created by Dmitry Figol</description>
              <enabled>true</enabled>
              <admin-status>UP</admin-status>
              <oper-status>UP</oper-status>
              <last-change>2017-11-12T15:14:11.00009+00:00</last-change>
              <counters>
                <in-octets>0</in-octets>
                <in-unicast-pkts>0</in-unicast-pkts>
                <in-broadcast-pkts>0</in-broadcast-pkts>
                <in-multicast-pkts>0</in-multicast-pkts>
                <in-discards>0</in-discards>
                <in-errors>0</in-errors>
                <out-octets>0</out-octets>
                <out-unicast-pkts>0</out-unicast-pkts>
                <out-broadcast-pkts>0</out-broadcast-pkts>
                <out-multicast-pkts>0</out-multicast-pkts>
                <out-discards>0</out-discards>
                <out-errors>0</out-errors>
                <last-clear>2017-11-12T15:08:03.000434+00:00</last-clear>
              </counters>
            </state>
            <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
              <config>
                <enabled>false</enabled>
              </config>
              <state>
                <enabled>false</enabled>
              </state>
            </ipv6>
          </subinterface>
        </subinterfaces>
      </interface>
    </interfaces>
  </data>
</rpc-reply>



Libyang ERROR: Failed to resolve augment "/openconfig-interfaces:interfaces/openconfig-interfaces:interface/openconfig-if-ethernet:ethernet/openconfig-if-ethernet:state". Path: '/openconfig-if-aggregate:/openconfig-interfaces:interfaces/openconfig-interfaces:interface/openconfig-if-ethernet:ethernet/openconfig-if-ethernet:state'
Traceback (most recent call last):
  File "test_ydk.py", line 25, in <module>
    main()
  File "test_ydk.py", line 22, in main
    interfaces = crud.read(provider, query)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 112, in helper
    return func(self, provider, entity, *args, **kwargs)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/services/crud_service.py", line 35, in read
    return self._crud.read(provider, read_filter)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
    exec("raise exc from None")
  File "<string>", line 1, in <module>
ydk.errors.YPYModelError:  Failed to resolve augment "/openconfig-interfaces:interfaces/openconfig-interfaces:interface/openconfig-if-ethernet:ethernet/openconfig-if-ethernet:state". Path: /openconfig-if-aggregate:/openconfig-interfaces:interfaces/openconfig-interfaces:interface/openconfig-if-ethernet:ethernet/openconfig-if-ethernet:state
Disconnected from device
@ghost ghost added the bug label Nov 16, 2017
@nahun
Copy link

nahun commented Feb 16, 2018

I have the same issue on different hardware and versions:

Python 2.7.12, Ubuntu 16.04
Tested on ASR1002-X running 16.7.1

$ pip freeze | grep ydk
ydk==0.7.0
ydk-models-cisco-ios-xe==16.7.1
ydk-models-ietf==0.1.4
ydk-models-openconfig==0.1.4

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

2 participants