Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions scripts/config_validator.py

This file was deleted.

29 changes: 0 additions & 29 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import sys
import traceback
import re
import subprocess

from sonic_py_common import device_info, logger
from swsscommon.swsscommon import SonicV2Connector, ConfigDBConnector, SonicDBConfig
Expand Down Expand Up @@ -1325,34 +1324,6 @@ def migrate(self):
version = next_version
# Perform common migration ops
self.common_migration_ops()
# Perform yang validation
self.validate()

def validate(self):
config = self.configDB.get_config()
# Fix table key in tuple
for table_name, table in config.items():
new_table = {}
hit = False
for table_key, table_val in table.items():
if isinstance(table_key, tuple):
new_key = "|".join(table_key)
new_table[new_key] = table_val
hit = True
else:
new_table[table_key] = table_val
if hit:
config[table_name] = new_table
config_file = "/tmp/validate.json"
with open(config_file, 'w') as fp:
json.dump(config, fp)
process = subprocess.Popen(["config_validator.py", "-c", config_file])
# Check validation result for unit test
# Check validation result for end to end test
mark_file = "/etc/sonic/mgmt_test_mark"
if os.environ.get("UTILITIES_UNIT_TESTING", "0") == "2" or os.path.exists(mark_file):
ret = process.wait()
assert ret == 0, "Yang validation failed"

def main():
try:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
'scripts/buffershow',
'scripts/coredump-compress',
'scripts/configlet',
'scripts/config_validator.py',
'scripts/db_migrator.py',
'scripts/decode-syseeprom',
'scripts/dropcheck',
Expand Down
Loading