File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1133,14 +1133,16 @@ import json
11331133
11341134yang_parser = sonic_yang.SonicYang("/usr/local/yang-models")
11351135yang_parser.loadYangModel()
1136- text = '''%s'''
1137-
1138- try:
1139- yang_parser.loadData(configdbJson=json.loads(text))
1140- yang_parser.validate_data_tree()
1141- except sonic_yang.SonicYangException as e:
1142- print("Yang validation error: {}".format(str(e)))
1143- raise
1136+ filename = "%s"
1137+ with open(filename, 'r') as fp:
1138+ text = fp.read()
1139+
1140+ try:
1141+ yang_parser.loadData(configdbJson=json.loads(text))
1142+ yang_parser.validate_data_tree()
1143+ except sonic_yang.SonicYangException as e:
1144+ print("Yang validation error: {}".format(str(e)))
1145+ raise
11441146`
11451147
11461148func (c * MixedDbClient ) SetIncrementalConfig (delete []* gnmipb.Path , replace []* gnmipb.Update , update []* gnmipb.Update ) error {
You can’t perform that action at this time.
0 commit comments