Skip to content

Commit 9d4d843

Browse files
authored
Merge branch 'master' into master
2 parents 2ac1886 + 3363587 commit 9d4d843

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

sonic_data_client/mixed_db_client.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,14 +1133,16 @@ import json
11331133
11341134
yang_parser = sonic_yang.SonicYang("/usr/local/yang-models")
11351135
yang_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

11461148
func (c *MixedDbClient) SetIncrementalConfig(delete []*gnmipb.Path, replace []*gnmipb.Update, update []*gnmipb.Update) error {

0 commit comments

Comments
 (0)