04-25-2019 06:39 AM
I'm using the newest available docker image of ydk-py. I'm using a script that takes in a YAML representation of YANG modeled configuration. When I try applying a router id for BGP, it says the attribute doesn't exist even though the YANG model suggests it does. Can anyone see something I'm doing wrong?
YANG path attached
YAML File attached
python recursion code at error attached
Error attached
Solved! Go to Solution.
04-25-2019 06:53 AM
04-25-2019 06:53 AM
04-25-2019 07:16 AM
Thanks a lot. I was putting dashes in the fields based on what it looked like in the pyang output of the YANG model versus what is expected in the attached API document which are underscores.
04-25-2019 08:03 AM
I fixed the YAML to underscores but now I get the following:
root@2fbb1af0ab2a:~/ydk-py/yang/yaml-101# python 1_send_yaml.py bgp bgp.yaml
Traceback (most recent call last):
File "1_send_yaml.py", line 32, in <module>
sys.exit(main())
File "1_send_yaml.py", line 24, in main
interface = YdkModel(args.model, data_parsed)
File "/root/ydk-py/yang/yaml-101/ydk_yaml.py", line 43, in __init__
instantiate(self.binding, k, v)
File "/root/ydk-py/yang/yaml-101/ydk_yaml.py", line 21, in instantiate
instantiate(container_instance, k, v, action='assign')
File "/root/ydk-py/yang/yaml-101/ydk_yaml.py", line 12, in instantiate
getattr(binding, model_key).append(instantiate(binding, model_key, el, action='return'))
File "/root/ydk-py/yang/yaml-101/ydk_yaml.py", line 21, in instantiate
instantiate(container_instance, k, v, action='assign')
File "/root/ydk-py/yang/yaml-101/ydk_yaml.py", line 12, in instantiate
getattr(binding, model_key).append(instantiate(binding, model_key, el, action='return'))
File "/usr/local/lib/python2.7/dist-packages/ydk/types/py_types.py", line 621, in append
self._log_error_and_raise_exception(msg, YInvalidArgumentError)
File "/usr/local/lib/python2.7/dist-packages/ydk/types/py_types.py", line 459, in _log_error_and_raise_exception
raise exception_class(msg)
ydk.errors.YInvalidArgumentError: Argument <class 'ydk.types.py_types.YList'> is not supported by YList class; data ignored
Not sure what it doesn't like here.
04-29-2019 10:52 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide