diff --git a/config/main.py b/config/main.py index 65b669be7f8..89d11b5b68f 100644 --- a/config/main.py +++ b/config/main.py @@ -1954,7 +1954,9 @@ def override_config_table(db, input_config_db, dry_run): updated_config = update_config(current_config, ns_config_input) yang_enabled = device_info.is_yang_config_validation_enabled(config_db) - if yang_enabled: + + # Always enable YANG check + if yang_enabled or True: # The ConfigMgmt will load YANG and running # config during initialization. try: @@ -1963,9 +1965,9 @@ def override_config_table(db, input_config_db, dry_run): except Exception as ex: click.secho("Failed to validate running config. Error: {}".format(ex), fg="magenta") sys.exit(1) - - # Validate input config - validate_config_by_cm(cm, ns_config_input, "config_input") + #skip input override config check since it is missing YANG dependencies + ## Validate input config + #validate_config_by_cm(cm, ns_config_input, "config_input") # Validate updated whole config validate_config_by_cm(cm, updated_config, "updated_config") diff --git a/tests/config_override_test.py b/tests/config_override_test.py index 19d2ddc197c..e00f7777a03 100644 --- a/tests/config_override_test.py +++ b/tests/config_override_test.py @@ -211,17 +211,6 @@ def is_yang_config_validation_enabled_side_effect(filename): self.check_yang_verification_failure( db, config, read_data['running_config'], read_data['golden_config'], "running config") - def test_golden_input_yang_failure(self): - def is_yang_config_validation_enabled_side_effect(filename): - return True - db = Db() - with open(GOLDEN_INPUT_YANG_FAILURE, "r") as f: - read_data = json.load(f) - with mock.patch('config.main.device_info.is_yang_config_validation_enabled', - mock.MagicMock(side_effect=is_yang_config_validation_enabled_side_effect)): - self.check_yang_verification_failure( - db, config, read_data['running_config'], read_data['golden_config'], "config_input") - def test_final_config_yang_failure(self): def is_yang_config_validation_enabled_side_effect(filename): return True