Skip to content

Commit

Permalink
[config/config_mgmt.py]: Use loadData functions, which handles allowT…
Browse files Browse the repository at this point in the history
…ablesWithOutYang too.

Signed-off-by: Praveen Chaudhary [email protected]
  • Loading branch information
Praveen Chaudhary committed Jun 30, 2020
1 parent b8f0c09 commit efbcc3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions config/config_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ def __init__(self, source="configDB", debug=False, allowTablesWithOutYang=True):
else:
self.readConfigDBJson(source)
# this will crop config, xlate and load.
self.sy.load_data(self.configdbJsonIn)

# Raise if tables without YANG models are not allowed but exist.
if not allowTablesWithOutYang and len(self.sy.tablesWithOutYang):
raise Exception('Config has tables without YANG models')
self.loadData(self.configdbJsonIn)

except Exception as e:
print(e)
Expand Down Expand Up @@ -422,7 +418,7 @@ def addPorts(self, ports=list(), portJson=dict(), loadDefConfig=True):

# create a tree with merged config and validate, if validation is
# sucessful, then configdbJsonOut contains final and valid config.
self.sy.load_data(self.configdbJsonOut)
self.loadData(self.configdbJsonOut)
if self.validateConfigData()==False:
return configToLoad, False

Expand Down

0 comments on commit efbcc3b

Please sign in to comment.