File tree Expand file tree Collapse file tree 3 files changed +18
-24
lines changed Expand file tree Collapse file tree 3 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,10 @@ enum lyd_type {
296
296
LYD_TYPE_REPLY_YANG ,
297
297
LYD_TYPE_RPC_NETCONF ,
298
298
LYD_TYPE_NOTIF_NETCONF ,
299
- LYD_TYPE_REPLY_NETCONF
299
+ LYD_TYPE_REPLY_NETCONF ,
300
+ LYD_TYPE_RPC_RESTCONF ,
301
+ LYD_TYPE_NOTIF_RESTCONF ,
302
+ LYD_TYPE_REPLY_RESTCONF
300
303
};
301
304
302
305
#define LYD_PRINT_KEEPEMPTYCONT ...
Original file line number Diff line number Diff line change @@ -174,22 +174,10 @@ def dup_flags(
174
174
175
175
176
176
# -------------------------------------------------------------------------------------
177
- def data_type (dtype ):
178
- if dtype == DataType .DATA_YANG :
179
- return lib .LYD_TYPE_DATA_YANG
180
- if dtype == DataType .RPC_YANG :
181
- return lib .LYD_TYPE_RPC_YANG
182
- if dtype == DataType .NOTIF_YANG :
183
- return lib .LYD_TYPE_NOTIF_YANG
184
- if dtype == DataType .REPLY_YANG :
185
- return lib .LYD_TYPE_REPLY_YANG
186
- if dtype == DataType .RPC_NETCONF :
187
- return lib .LYD_TYPE_RPC_NETCONF
188
- if dtype == DataType .NOTIF_NETCONF :
189
- return lib .LYD_TYPE_NOTIF_NETCONF
190
- if dtype == DataType .REPLY_NETCONF :
191
- return lib .LYD_TYPE_REPLY_NETCONF
192
- raise ValueError ("Unknown data type" )
177
+ def data_type (dtype : DataType ) -> int :
178
+ if type (dtype ) is not DataType :
179
+ dtype = DataType (dtype )
180
+ return dtype .value
193
181
194
182
195
183
# -------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -77,13 +77,16 @@ class IOType(enum.Enum):
77
77
78
78
# -------------------------------------------------------------------------------------
79
79
class DataType (enum .Enum ):
80
- DATA_YANG = enum .auto ()
81
- RPC_YANG = enum .auto ()
82
- NOTIF_YANG = enum .auto ()
83
- REPLY_YANG = enum .auto ()
84
- RPC_NETCONF = enum .auto ()
85
- NOTIF_NETCONF = enum .auto ()
86
- REPLY_NETCONF = enum .auto ()
80
+ DATA_YANG = lib .LYD_TYPE_DATA_YANG
81
+ RPC_YANG = lib .LYD_TYPE_RPC_YANG
82
+ NOTIF_YANG = lib .LYD_TYPE_NOTIF_YANG
83
+ REPLY_YANG = lib .LYD_TYPE_REPLY_YANG
84
+ RPC_NETCONF = lib .LYD_TYPE_RPC_NETCONF
85
+ NOTIF_NETCONF = lib .LYD_TYPE_NOTIF_NETCONF
86
+ REPLY_NETCONF = lib .LYD_TYPE_REPLY_NETCONF
87
+ RPC_RESTCONF = lib .LYD_TYPE_RPC_RESTCONF
88
+ NOTIF_RESTCONF = lib .LYD_TYPE_NOTIF_RESTCONF
89
+ REPLY_RESTCONF = lib .LYD_TYPE_REPLY_RESTCONF
87
90
88
91
89
92
# -------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments