Skip to content

Commit 4bed4d7

Browse files
authored
revert YANG check in db_migrator (#3793)
What I did revert YANG check in db_migrator How I did it revert How to verify it revert
1 parent d6e1bf4 commit 4bed4d7

File tree

3 files changed

+0
-74
lines changed

3 files changed

+0
-74
lines changed

scripts/config_validator.py

-44
This file was deleted.

scripts/db_migrator.py

-29
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sys
77
import traceback
88
import re
9-
import subprocess
109

1110
from sonic_py_common import device_info, logger
1211
from swsscommon.swsscommon import SonicV2Connector, ConfigDBConnector, SonicDBConfig
@@ -1368,34 +1367,6 @@ def migrate(self):
13681367
version = next_version
13691368
# Perform common migration ops
13701369
self.common_migration_ops()
1371-
# Perform yang validation
1372-
self.validate()
1373-
1374-
def validate(self):
1375-
config = self.configDB.get_config()
1376-
# Fix table key in tuple
1377-
for table_name, table in config.items():
1378-
new_table = {}
1379-
hit = False
1380-
for table_key, table_val in table.items():
1381-
if isinstance(table_key, tuple):
1382-
new_key = "|".join(table_key)
1383-
new_table[new_key] = table_val
1384-
hit = True
1385-
else:
1386-
new_table[table_key] = table_val
1387-
if hit:
1388-
config[table_name] = new_table
1389-
config_file = "/tmp/validate.json"
1390-
with open(config_file, 'w') as fp:
1391-
json.dump(config, fp)
1392-
process = subprocess.Popen(["config_validator.py", "-c", config_file])
1393-
# Check validation result for unit test
1394-
# Check validation result for end to end test
1395-
mark_file = "/etc/sonic/mgmt_test_mark"
1396-
if os.environ.get("UTILITIES_UNIT_TESTING", "0") == "2" or os.path.exists(mark_file):
1397-
ret = process.wait()
1398-
assert ret == 0, "Yang validation failed"
13991370

14001371
def main():
14011372
try:

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
'scripts/buffershow',
117117
'scripts/coredump-compress',
118118
'scripts/configlet',
119-
'scripts/config_validator.py',
120119
'scripts/db_migrator.py',
121120
'scripts/decode-syseeprom',
122121
'scripts/dropcheck',

0 commit comments

Comments
 (0)