|
6 | 6 | import sys
|
7 | 7 | import traceback
|
8 | 8 | import re
|
9 |
| -import sonic_yang |
10 |
| -import syslog |
11 | 9 |
|
12 | 10 | from sonic_py_common import device_info, logger
|
13 | 11 | from swsscommon.swsscommon import SonicV2Connector, ConfigDBConnector, SonicDBConfig
|
14 | 12 | from minigraph import parse_xml
|
15 | 13 |
|
16 | 14 | INIT_CFG_FILE = '/etc/sonic/init_cfg.json'
|
17 | 15 | MINIGRAPH_FILE = '/etc/sonic/minigraph.xml'
|
18 |
| -YANG_MODELS_DIR = "/usr/local/yang-models" |
19 | 16 |
|
20 | 17 | # mock the redis for unit test purposes #
|
21 | 18 | try:
|
@@ -1164,31 +1161,6 @@ def migrate(self):
|
1164 | 1161 | version = next_version
|
1165 | 1162 | # Perform common migration ops
|
1166 | 1163 | self.common_migration_ops()
|
1167 |
| - config = self.configDB.get_config() |
1168 |
| - # Fix table key in tuple |
1169 |
| - for table_name, table in config.items(): |
1170 |
| - new_table = {} |
1171 |
| - hit = False |
1172 |
| - for table_key, table_val in table.items(): |
1173 |
| - if isinstance(table_key, tuple): |
1174 |
| - new_key = "|".join(table_key) |
1175 |
| - new_table[new_key] = table_val |
1176 |
| - hit = True |
1177 |
| - else: |
1178 |
| - new_table[table_key] = table_val |
1179 |
| - if hit: |
1180 |
| - config[table_name] = new_table |
1181 |
| - # Run yang validation |
1182 |
| - yang_parser = sonic_yang.SonicYang(YANG_MODELS_DIR) |
1183 |
| - yang_parser.loadYangModel() |
1184 |
| - try: |
1185 |
| - yang_parser.loadData(configdbJson=config) |
1186 |
| - yang_parser.validate_data_tree() |
1187 |
| - except sonic_yang.SonicYangException as e: |
1188 |
| - syslog.syslog(syslog.LOG_CRIT, "Yang validation failed: " + str(e)) |
1189 |
| - if os.environ["UTILITIES_UNIT_TESTING"] == "2": |
1190 |
| - raise |
1191 |
| - |
1192 | 1164 |
|
1193 | 1165 | def main():
|
1194 | 1166 | try:
|
|
0 commit comments