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

Absolute path for generated entity of second level list child is incorrect #933

Closed
ygorelik opened this issue Jun 18, 2019 · 1 comment
Closed

Comments

@ygorelik
Copy link
Collaborator

Current Behavior

If we have two level list model:

    container two-list {
      list ldata {
        description "first level list data";
        key "number";
        leaf number {
          type int32;
        }
        leaf name {
          type string;
        }

        list subl1 {
          description "second level list data";
          key "number";
          leaf number {
            type int32;
          }
          leaf name {
            type string;
          }
        }
      }
    }

The generated bundle code does not contain definition of absolute path for second level list entity. Correspondent function returns empty string, which is wrong.

Expected Behavior

The second level list entity should calculate absolute path as:

self._absolute_path = self.parent._absolute_path + '/' + self._segment_path

Your Script

from ydk.models.ydktest import ydktest_sanity as ysanity
r_1 = ysanity.Runner()
e_1 = ysanity.Runner.TwoList.Ldata()
e_11 = ysanity.Runner.TwoList.Ldata.Subl1()
e_1.number = 21
e_1.name = 'first-level'
e_11.number = 211
e_11.name = 'second-level'
e_1.subl1.append(e_11)
r_1.two_list.ldata.append(e_1)
print('')
print("Segment path : %s" % e_11.get_segment_path())
print("Absolute path: %s" % e_11.get_absolute_path())

Output

Segment path : subl1[number='211']
Absolute path: 

System Information

YDK-0.8.3

@ygorelik
Copy link
Collaborator Author

Resolved in 0.8.4 together with this commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant