From b48035de385a932df28fb5f8dbcec06a5705de0d Mon Sep 17 00:00:00 2001 From: Jingwen Xie Date: Fri, 12 Aug 2022 05:54:04 +0000 Subject: [PATCH 1/3] Add yang_config_validation in device_info --- src/sonic-py-common/sonic_py_common/device_info.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 73654b8819b8..6126dd6dd284 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -403,6 +403,10 @@ def get_chassis_info(): return chassis_info_dict + +def is_yang_config_validation_enabled(config_db): + return get_localhost_info('yang_config_validation', config_db) == 'enable' + # # Multi-NPU functionality # From 644476bc4b7f1312ba835108167181922da458e0 Mon Sep 17 00:00:00 2001 From: Jingwen Xie Date: Fri, 12 Aug 2022 06:37:19 +0000 Subject: [PATCH 2/3] add default value --- src/sonic-py-common/sonic_py_common/device_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 6126dd6dd284..facd3fa5b0f4 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -404,7 +404,7 @@ def get_chassis_info(): return chassis_info_dict -def is_yang_config_validation_enabled(config_db): +def is_yang_config_validation_enabled(config_db=None): return get_localhost_info('yang_config_validation', config_db) == 'enable' # From 736235e4117fe33f4a2aad8c939716e510dc7f1e Mon Sep 17 00:00:00 2001 From: Jingwen Xie Date: Mon, 15 Aug 2022 04:16:11 +0000 Subject: [PATCH 3/3] Revert "add default value" This reverts commit 644476bc4b7f1312ba835108167181922da458e0. --- src/sonic-py-common/sonic_py_common/device_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index facd3fa5b0f4..6126dd6dd284 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -404,7 +404,7 @@ def get_chassis_info(): return chassis_info_dict -def is_yang_config_validation_enabled(config_db=None): +def is_yang_config_validation_enabled(config_db): return get_localhost_info('yang_config_validation', config_db) == 'enable' #