Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.
Expected Behavior
Model packages should be able to support any valid YANG model.
Current Behavior
In models with containers and lists named 'entity', the generated Python module doesn't disambiguate the class name correctly:
$ grep "class Entity(Entity):" *.py
Cisco_IOS_XR_invmgr_cfg.py: class Entity(Entity):
Cisco_IOS_XR_invmgr_oper.py: class Entity(Entity):
Cisco_IOS_XR_invmgr_oper.py: class Entity(Entity):
Cisco_IOS_XR_snmp_agent_cfg.py: class Entity(Entity):
$
$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ydk.models.cisco_ios_xr.Cisco_IOS_XR_invmgr_oper import Inventory
>>>
>>> inventory = Inventory()
>>> rack = inventory.racks.Rack()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/ydk/models/cisco_ios_xr/Cisco_IOS_XR_invmgr_oper.py", line 3804, in __init__
self.powershelf = Inventory.Racks.Rack.Powershelf()
File "/usr/local/lib/python3.6/dist-packages/ydk/models/cisco_ios_xr/Cisco_IOS_XR_invmgr_oper.py", line 40817, in __init__
self.yang_name = "powershelf"
File "/usr/local/lib/python3.6/dist-packages/ydk/models/cisco_ios_xr/Cisco_IOS_XR_invmgr_oper.py", line 40830, in __setattr__
self._perform_setattr(Inventory.Racks.Rack.Powershelf, [], name, value)
File "/usr/local/lib/python3.6/dist-packages/ydk/types/py_types.py", line 350, in _perform_setattr
self.__class__.__name__))
ydk.errors.YModelError: Attempt to assign unknown attribute 'yang_name' to 'Powershelf'.
>>>
Your Script
from ydk.models.cisco_ios_xr.Cisco_IOS_XR_invmgr_oper import Inventory
inventory = Inventory()
rack = inventory.racks.Rack()
Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.
Expected Behavior
Model packages should be able to support any valid YANG model.
Current Behavior
In models with containers and lists named 'entity', the generated Python module doesn't disambiguate the class name correctly:
Disambiguation works correctly for leaf nodes:
Steps to Reproduce
Your Script
Logs
Enable logging and post the logs below
System Information