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

YDK 0.7.1 - Couldn't fetch child entity interface in parent /ietf-interfaces:interfaces-state!

m.m.mazurek
Level 1
Level 1

Hi,

I am trying to run linuxcfg example from confd-basic (6.3 and not newer a YDK doesn't support YANG 1.1 - python classes generation fails).

NETCONF query works just fine and returns as expected a list of interfaces (as this is what I am asking for).

interfacesState = InterfacesState()

interfacesState = crud.read(provider, interfacesState)


When read wants to build InterfacesState() object it fails as below:


Looking at parent entity interfaces-state

Looking at child list '/ietf-interfaces:interfaces-state/interface[name='lo']'

Going into child interface in parent /ietf-interfaces:interfaces-state

Couldn't fetch child entity interface in parent /ietf-interfaces:interfaces-state!

Traceback (most recent call last):

  File "/home/ydk_user/PycharmProjects/ydk/linuxcfg.py", line 29, in <module>

    interfacesState = crud.read(provider, interfacesState)

  File "/home/ydk_user/.local/lib/python2.7/site-packages/ydk/services/crud_service.py", line 63, in read

    read_entity = self._crud.read(provider, filters)

  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__

    self.gen.throw(type, value, traceback)

  File "/home/ydk_user/.local/lib/python2.7/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error

    _raise(_exc)

  File "/home/ydk_user/.local/lib/python2.7/site-packages/ydk/errors/error_handler.py", line 56, in _raise

    raise exc

ydk.errors.YCoreError:  Couldn't fetch child entity 'interface' in parent /ietf-interfaces:interfaces-state

Disconnected from device

Trace: Writing message (session 17): <?xml version="1.0" encoding="UTF-8"?>

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">

  <close-session/>

</rpc>

Issue is in function (py_types.py) which shows that _children_name_map attribute of InterfaceState is basically empty and cannot fetch any children:

    def _get_child_by_seg_name(self, segs):

        for seg in segs:

            for name in self._children_name_map:

                if seg == self._children_name_map[name]:

                    return self.__dict__[name]

        return None

Br,

M

1 Accepted Solution

Accepted Solutions

Got it. I was trying the pre-generated package from pypi.

Can you try running the 'generate.py' again after checking out the '0.7.1' tag of ydk-gen? Please uninstall the previous package and use the package generated with this.

cd ydk-gen
git checkout 0.7.1
./generate.py...

View solution in original post

4 Replies 4

abhirame
Cisco Employee
Cisco Employee

I'm not able to reproduce the issue with the below environment

> pip list|grep ydk
ydk (0.7.1)
ydk-models-ietf (0.1.5)

I took raw Yang models from confd6.3 and generated classes with ydk-gen. Have you done the same?

Got it. I was trying the pre-generated package from pypi.

Can you try running the 'generate.py' again after checking out the '0.7.1' tag of ydk-gen? Please uninstall the previous package and use the package generated with this.

cd ydk-gen
git checkout 0.7.1
./generate.py...

Thank you - have you made some changes to the code ? I did the installation as follows:

wget https://devhub.cisco.com/artifactory/debian-ydk/0.7.1/libydk_0.7.1-1_amd64.deb