-
Notifications
You must be signed in to change notification settings - Fork 78
Max value of range is set to None when not specified in the Yang model #916
Copy link
Copy link
Closed
Description
Reported by Leon Xu leoxu@cisco.com
Expected Behavior
When leaf node defines int type and range contains single value it should appear in the YDK generated metadata as a range with the same value for min and max.
Current Behavior
When leaf node defines int type and range contains single value the max value in metadata appears as None. Example:
_Cisco_IOS_XR_sysadmin_sm.py: [('0', 'None')], [],
This creates error conditions in Python runtime:
## From Yang file ##
container label {
description "Label properties";
container range {
description "Label range";
list table {
key "table-index";
description "Specify label table";
leaf table-index {
type uint32 {
range "0" {
description "Label table index";
}
}
description "Label table index";
}
## From YDK py file ##
class Table(object):
"""
Specify label table
.. attribute:: table_index <key>
Label table index
**type**\: int
**range:** 0..None
## Template file ##
- iosxr:
ydk_service_operators:
- create
- delete
modes:
- positive
- positive
num_operations: 1
triggers: []
enable_triggers: false
sleep: 10
failed_reason: []
verify_cli_cmds: []
config_paths:
- feature: mpls_lsd
parent: table_cfg
path: $table_cfg
ydk_internal_operator: ''
leaf_dict:
table_index:
type: int
ytype: uint32
range:
- 0
- None
values:
- 0
maximum_label:
type: int
ytype: uint32
range:
- 16000
- 1048575
values:
- 959517
minimum_label:
type: int
ytype: uint32
range:
- 16000
- 1048575
values:
- 900583
2975: ##
2976: [host 64.104.148.26 session-id 3367002746] Received:
2977: <?xml version="1.0"?>
2978: <rpc-reply message-id="urn:uuid:4c2aeada-47e4-4d3c-9acb-4488ccb416ff" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
2979: <ok/>
2980: </rpc-reply>
2981:
2982: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4c2aeada-47e4-4d3c-9acb-4488ccb416ff">
2983: <ok/>
2984: </rpc-reply>
2985: Executor operation completed
2986: CREATE operation initiated
2987: CREATE operation completed
2988: Failed reason: Mpls.Label.Range.Table_test: Mpls.Label.Range.Table_test: create:crud failed due to invalid literal for int() with base 10: 'None'
2989: The result of section test is => FAILED
System Information
YDK-0.5.5 and 0.8.2
Reactions are currently unavailable