CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
135 stars 74 forks source link

ExecutorService fails on non-ietf RPC with Libyang error #1067

Closed jayapr closed 2 years ago

jayapr commented 2 years ago

Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.

Expected Behavior

Ping RPC should be generated correctly

Current Behavior

Error is thrown: Creating new data path 'destination' with value '224.0.0.5' in 'ipv4' Debug---:ydk:Creating new data path 'destination' with value '224.0.0.5' in 'ipv4' 2022-06-09 23:02:16,889 - ydk - Error--- - Data is invalid according to the yang model. Libyang error: Node already exists. Path: 'destination' 2022-06-09 23:02:16,889 - ydk - Error--- - Data is invalid according to the yang model. Libyang error: Node already exists. Path: 'destination' Data is invalid according to the yang model. Libyang error: Node already exists. Path: 'destination' Error---:ydk:Data is invalid according to the yang model. Libyang error: Node already exists. Path: 'destination' 2022-06-09 23:02:16,890 - ydk - Error--- - Could not create data node: destination for path: 'ipv4[destination='224.0.0.5']/destination', value: '224.0.0.5' 2022-06-09 23:02:16,890 - ydk - Error--- - Could not create data node: destination for path: 'ipv4[destination='224.0.0.5']/destination', value: '224.0.0.5' Could not create data node: destination for path: 'ipv4[destination='224.0.0.5']/destination', value: '224.0.0.5' Error---:ydk:Could not create data node: destination for path: 'ipv4[destination='224.0.0.5']/destination', value: '224.0.0.5' topology.connection.connexceptions.ReadError: YModelError Could not create data node: destination : Node already exists.. Path: destination

Steps to Reproduce

Your Script

import os from ydk.filters import YFilter from ydk.services import ExecutorService from ydk.providers import NetconfServiceProvider from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ping_act as ping_act

exec = ExecutorService() provider = NetconfServiceProvider(address="10.105.247.151", username="cafyauto", password="cisco123")

destination="224.0.0.5" ping_rpc = ping_act.Ping() ipv4 = ping_rpc.Input.Ipv4() ipv4.destination = destination ping_rpc.input.ipv4.append(ipv4) exec.execute_rpc(provider, ping_rpc)

Logs

Enable logging and post the logs below

System Information