File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -476,6 +476,23 @@ def _find_data_nodes(self, data_xpath):
476
476
def _find_schema_dependencies (self , match_path , match_ancestors : bool = False ):
477
477
return self .ctx .find_backlinks_paths (match_path , match_ancestors = match_ancestors )
478
478
479
+ """
480
+ load_module_str_name(): load a module based on the provided string and return
481
+ the loaded module name. This is needed by
482
+ sonic-yang-modules to prevent direct dependency on
483
+ libyang.
484
+ input: yang_module_str yang-formatted module
485
+ returns: module name on success, exception on failure
486
+ """
487
+ def load_module_str_name (yang_module_str ):
488
+ try :
489
+ module = self .ctx .parse_module_str (yang_module_str )
490
+ except Exception as e :
491
+ self .fail (e );
492
+ else :
493
+ return module .name ()
494
+
495
+ return None
479
496
480
497
"""
481
498
find_data_dependencies(): find the data dependencies from data xpath (Public)
You can’t perform that action at this time.
0 commit comments