diff --git a/sonic_data_client/mixed_db_client.go b/sonic_data_client/mixed_db_client.go index 02b2bb94..71aaca57 100644 --- a/sonic_data_client/mixed_db_client.go +++ b/sonic_data_client/mixed_db_client.go @@ -1133,14 +1133,16 @@ import json yang_parser = sonic_yang.SonicYang("/usr/local/yang-models") yang_parser.loadYangModel() -text = '''%s''' - -try: - yang_parser.loadData(configdbJson=json.loads(text)) - yang_parser.validate_data_tree() -except sonic_yang.SonicYangException as e: - print("Yang validation error: {}".format(str(e))) - raise +filename = "%s" +with open(filename, 'r') as fp: + text = fp.read() + + try: + yang_parser.loadData(configdbJson=json.loads(text)) + yang_parser.validate_data_tree() + except sonic_yang.SonicYangException as e: + print("Yang validation error: {}".format(str(e))) + raise ` func (c *MixedDbClient) SetIncrementalConfig(delete []*gnmipb.Path, replace []*gnmipb.Update, update []*gnmipb.Update) error {