@@ -35,7 +35,7 @@ class ConfigMgmt():
35
35
to verify config for the commands which are capable of change in config DB.
36
36
'''
37
37
38
- def __init__ (self , source = "configDB" , debug = False , allowTablesWithoutYang = True ):
38
+ def __init__ (self , source = "configDB" , debug = False , allowTablesWithoutYang = True , sonicYangOptions = 0 ):
39
39
'''
40
40
Initialise the class, --read the config, --load in data tree.
41
41
@@ -53,6 +53,7 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True):
53
53
self .configdbJsonOut = None
54
54
self .source = source
55
55
self .allowTablesWithoutYang = allowTablesWithoutYang
56
+ self .sonicYangOptions = sonicYangOptions
56
57
57
58
# logging vars
58
59
self .SYSLOG_IDENTIFIER = "ConfigMgmt"
@@ -67,7 +68,7 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True):
67
68
return
68
69
69
70
def __init_sonic_yang (self ):
70
- self .sy = sonic_yang .SonicYang (YANG_DIR , debug = self .DEBUG )
71
+ self .sy = sonic_yang .SonicYang (YANG_DIR , debug = self .DEBUG , sonic_yang_options = self . sonicYangOptions )
71
72
# load yang models
72
73
self .sy .loadYangModel ()
73
74
# load jIn from config DB or from config DB json file.
@@ -280,7 +281,7 @@ def get_module_name(yang_module_str):
280
281
"""
281
282
282
283
# Instantiate new context since parse_module_mem() loads the module into context.
283
- sy = sonic_yang .SonicYang (YANG_DIR )
284
+ sy = sonic_yang .SonicYang (YANG_DIR , sonic_yang_options = self . sonicYangOptions )
284
285
module = sy .ctx .parse_module_mem (yang_module_str , ly .LYS_IN_YANG )
285
286
return module .name ()
286
287
0 commit comments