From 84e80600881eda19b38c1046d0bcda5584122c6e Mon Sep 17 00:00:00 2001 From: mlok Date: Fri, 15 Nov 2024 17:34:50 -0500 Subject: [PATCH 01/10] [asic_sensor] Generate the aisc_sensors pulling configuration based on the platform.json Signed-off-by: mlok --- .../asic_sensors_config.py | 37 +++++++++++++++++++ src/sonic-config-engine/setup.py | 3 +- src/sonic-config-engine/sonic-cfggen | 6 ++- .../tests/data/asic_sensors/platform.json | 6 +++ src/sonic-config-engine/tests/test_cfggen.py | 10 +++++ 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/sonic-config-engine/asic_sensors_config.py create mode 100644 src/sonic-config-engine/tests/data/asic_sensors/platform.json diff --git a/src/sonic-config-engine/asic_sensors_config.py b/src/sonic-config-engine/asic_sensors_config.py new file mode 100644 index 000000000000..5eb280fd0d77 --- /dev/null +++ b/src/sonic-config-engine/asic_sensors_config.py @@ -0,0 +1,37 @@ +import os +import sys +import portconfig +from sonic_py_common import device_info + +try: + if os.environ["CFGGEN_UNIT_TESTING"] == "2": + modules_path = os.path.join(os.path.dirname(__file__), ".") + tests_path = os.path.join(modules_path, "tests") + sys.path.insert(0, modules_path) + sys.path.insert(0, tests_path) + import mock_tables.dbconnector + mock_tables.dbconnector.load_namespace_config() + +except KeyError: + pass + +ASIC_SENSORS_KEY = "asic_sensors" + + +def get_asic_sensors_config(): + config = {} + if os.environ.get("CFGGEN_UNIT_TESTING") == "2": + json_file = os.path.join(tests_path, "data", "asic_sensors", "platform.json") + else: + platform_path = device_info.get_path_to_platform_dir() + json_file = os.path.join(platform_path, device_info.PLATFORM_JSON_FILE) + platform_json = portconfig.readJson(json_file) + if not platform_json: + return config + + if ASIC_SENSORS_KEY in platform_json: + config["ASIC_SENSORS"] = {"ASIC_SENSORS_POLLER_INTERVAL": {"interval": platform_json[ASIC_SENSORS_KEY]["poll_interval"]}, + "ASIC_SENSORS_POLLER_STATUS": {"admin_status": platform_json[ASIC_SENSORS_KEY]["poll_admin_status"]} + } + + return config diff --git a/src/sonic-config-engine/setup.py b/src/sonic-config-engine/setup.py index 263f4cea43cb..71f928b9810a 100644 --- a/src/sonic-config-engine/setup.py +++ b/src/sonic-config-engine/setup.py @@ -52,7 +52,8 @@ 'minigraph', 'openconfig_acl', 'portconfig', - 'smartswitch_config' + 'smartswitch_config', + 'asic_sensors_config' ] if sys.version_info.major == 3: # Python 3-only modules diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 9151bfa20de1..f5ab20d17473 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -36,7 +36,7 @@ from portconfig import get_port_config, get_breakout_mode from sonic_py_common.multi_asic import get_asic_id_from_name, get_asic_device_id, is_multi_asic from sonic_py_common import device_info from swsscommon.swsscommon import ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector - +import asic_sensors_config PY3x = sys.version_info >= (3, 0) @@ -459,6 +459,10 @@ def main(): deep_update(data, hardware_data) + asic_sensors = asic_sensors_config.get_asic_sensors_config() + if asic_sensors: + deep_update(data, asic_sensors) + paths = ['/', '/usr/share/sonic/templates'] if args.template_dir: paths.append(os.path.abspath(args.template_dir)) diff --git a/src/sonic-config-engine/tests/data/asic_sensors/platform.json b/src/sonic-config-engine/tests/data/asic_sensors/platform.json new file mode 100644 index 000000000000..bfdb92eedd25 --- /dev/null +++ b/src/sonic-config-engine/tests/data/asic_sensors/platform.json @@ -0,0 +1,6 @@ +{ + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } +} diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 1ef66030244f..556e29bcecfb 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1155,3 +1155,13 @@ def testsnmp_agent_address_config(self): self.assertEqual( utils.liststr_to_dict(output.strip()), utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|', 'fe80::1%Management0|161|']")) + + def test_platform_asic_sensors_config(self): + os.environ["PLATFORM"] = "x86_64-kvm_x86_64-r0" + argument = ["-H","--print-data"] + output = self.run_script(argument, check_stderr=False) + config_json = utils.to_dict(output.strip()) + os.environ["PLATFORM"] = "" + self.assertEqual(config_json['ASIC_SENSORS'], utils.to_dict("{'ASIC_SENSORS_POLLER_INTERVAL': {'interval': '10'}, 'ASIC_SENSORS_POLLER_STATUS': {'admin_status': 'enable'}}")) + + From 61ecc45e71cf62d64bd657f9c79668b2eae52700 Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 21 Nov 2024 10:42:24 -0500 Subject: [PATCH 02/10] [YangModel][asic_sensors] Add Yang Model support for ASIC_SENSORs configuration Signed-off-by: mlok --- src/sonic-yang-models/doc/Configuration.md | 4 +++- src/sonic-yang-models/setup.py | 3 ++- src/sonic-yang-models/tests/files/sample_config_db.json | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 4c042b14e232..ae5c249b7535 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1,6 +1,8 @@ # SONiC Configuration Database Manual - **Table of Contents** +======= +Table of Contents +================= * [Introduction](#introduction) * [Configuration](#configuration) diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 39efe5c842df..a249e1918ed8 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -208,7 +208,8 @@ def run(self): './yang-models/sonic-xcvrd-log.yang', './yang-models/sonic-grpcclient.yang', './yang-models/sonic-serial-console.yang', - './yang-models/sonic-smart-switch.yang',]), + './yang-models/sonic-smart-switch.yang', + './yang-models/sonic-asic-sensors.yang',]), ('cvlyang-models', ['./cvlyang-models/sonic-acl.yang', './cvlyang-models/sonic-banner.yang', './cvlyang-models/sonic-bgp-common.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 67999dd9de4d..4c8002b2b890 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2818,5 +2818,13 @@ "daemon_polling_interval" : "3600", "fsstats_sync_interval" : "86400" } + }, + "ASIC_SENSORS": { + "ASIC_SENSORS_POLLER_INTERVAL": { + "interval": "10" + }, + "ASIC_SENSORS_POLLER_STATUS": { + "admin_status": "enable" + } } } From 74878dfbb8f8be8d37f9371bb316a6253879eb5f Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 21 Nov 2024 11:24:56 -0500 Subject: [PATCH 03/10] Fix 202405 cherry-pick conflict Signed-off-by: mlok --- src/sonic-yang-models/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index a249e1918ed8..1a750faa6903 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -208,8 +208,7 @@ def run(self): './yang-models/sonic-xcvrd-log.yang', './yang-models/sonic-grpcclient.yang', './yang-models/sonic-serial-console.yang', - './yang-models/sonic-smart-switch.yang', - './yang-models/sonic-asic-sensors.yang',]), + './yang-models/sonic-smart-switch.yang']), ('cvlyang-models', ['./cvlyang-models/sonic-acl.yang', './cvlyang-models/sonic-banner.yang', './cvlyang-models/sonic-bgp-common.yang', From f20ef07f92dd2974075fffcd410c258b143ba150 Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 21 Nov 2024 16:55:59 -0500 Subject: [PATCH 04/10] [sonic-yang-mgmt] Fix the yang-mgmt issue Signed-off-by: mlok --- .../tests/files/sample_config_db.json | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 4c8002b2b890..695b56d8a50b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2791,6 +2791,13 @@ "enabled": "false", "sampling_interval": "5", "retention_period": "15" + }, + "ASIC_SENSORS": { + "ASIC_SENSORS_POLLER_INTERVAL": { + "interval": "10" + }, + "ASIC_SENSORS_POLLER_STATUS": { + "admin_status": "enable" } }, "ASIC_SENSORS": { @@ -2818,13 +2825,5 @@ "daemon_polling_interval" : "3600", "fsstats_sync_interval" : "86400" } - }, - "ASIC_SENSORS": { - "ASIC_SENSORS_POLLER_INTERVAL": { - "interval": "10" - }, - "ASIC_SENSORS_POLLER_STATUS": { - "admin_status": "enable" - } } } From 892a423cc789478402eb2d35e78fcec237cb9fcb Mon Sep 17 00:00:00 2001 From: mlok Date: Sat, 30 Nov 2024 22:53:31 -0500 Subject: [PATCH 05/10] Address the comment by removing the Nokia platform specified related the code change Signed-off-by: mlok --- device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json | 6 +----- device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json | 6 +----- device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json | 7 +------ device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json | 6 +----- .../nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json | 6 +----- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json index 16e104341cdf..89a7a3e9ddf8 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json @@ -275,9 +275,5 @@ } ] }, - "interfaces": {}, - "asic_sensors": { - "poll_interval": "10", - "poll_admin_status": "enable" - } + "interfaces": {} } diff --git a/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json index 4c0acf7eb890..29e11388382c 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json @@ -495,9 +495,5 @@ } ] }, - "interfaces": {}, - "asic_sensors": { - "poll_interval": "10", - "poll_admin_status": "enable" - } + "interfaces": {} } diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json index 99562f3deb5a..b40c5fe9498d 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json @@ -447,10 +447,5 @@ } ] }, - "interfaces": {}, - - "asic_sensors": { - "poll_interval": "10", - "poll_admin_status": "enable" - } + "interfaces": {} } diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json index b330c66ff380..63f55d3eb01a 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json @@ -460,9 +460,5 @@ } ] }, - "interfaces": {}, - "asic_sensors": { - "poll_interval": "10", - "poll_admin_status": "enable" - } + "interfaces": {} } diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json index 4d34218672e9..ab881c4ccfdd 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json @@ -275,9 +275,5 @@ } ] }, - "interfaces": {}, - "asic_sensors": { - "poll_interval": "10", - "poll_admin_status": "enable" - } + "interfaces": {} } From c58fe50fef9336680ebc69fa97dcf2805a602f2f Mon Sep 17 00:00:00 2001 From: mlok Date: Mon, 2 Dec 2024 14:38:04 -0500 Subject: [PATCH 06/10] Address the review comments Signed-off-by: mlok --- src/sonic-config-engine/asic_sensors_config.py | 3 +-- src/sonic-config-engine/sonic-cfggen | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sonic-config-engine/asic_sensors_config.py b/src/sonic-config-engine/asic_sensors_config.py index 5eb280fd0d77..d10cdb3b9431 100644 --- a/src/sonic-config-engine/asic_sensors_config.py +++ b/src/sonic-config-engine/asic_sensors_config.py @@ -28,10 +28,9 @@ def get_asic_sensors_config(): platform_json = portconfig.readJson(json_file) if not platform_json: return config - + if ASIC_SENSORS_KEY in platform_json: config["ASIC_SENSORS"] = {"ASIC_SENSORS_POLLER_INTERVAL": {"interval": platform_json[ASIC_SENSORS_KEY]["poll_interval"]}, "ASIC_SENSORS_POLLER_STATUS": {"admin_status": platform_json[ASIC_SENSORS_KEY]["poll_admin_status"]} } - return config diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index f5ab20d17473..aed7a936eef0 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -459,7 +459,12 @@ def main(): deep_update(data, hardware_data) - asic_sensors = asic_sensors_config.get_asic_sensors_config() + asic_sensors = {} + if is_multi_asic(): + if asic_name is not None: + asic_sensors = asic_sensors_config.get_asic_sensors_config() + else: + asic_sensors = asic_sensors_config.get_asic_sensors_config() if asic_sensors: deep_update(data, asic_sensors) From 3c4a8dc7f81b32383542f3e2558474864b8d33ca Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 5 Dec 2024 18:15:18 -0500 Subject: [PATCH 07/10] Repalce tabs with spaces and fix UT failure --- src/sonic-yang-models/tests/files/sample_config_db.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 695b56d8a50b..8629c64e10cd 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2791,6 +2791,7 @@ "enabled": "false", "sampling_interval": "5", "retention_period": "15" + } }, "ASIC_SENSORS": { "ASIC_SENSORS_POLLER_INTERVAL": { From 9e5412421aeaf4ef709b51688730c17ebf71afea Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 19 Dec 2024 14:16:24 -0500 Subject: [PATCH 08/10] fix rebase issue --- device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json | 6 +++++- device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json | 6 +++++- device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json | 7 ++++++- device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json | 6 +++++- .../nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json | 6 +++++- src/sonic-yang-models/doc/Configuration.md | 4 +--- src/sonic-yang-models/setup.py | 2 +- src/sonic-yang-models/tests/files/sample_config_db.json | 8 -------- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json index 89a7a3e9ddf8..16e104341cdf 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json @@ -275,5 +275,9 @@ } ] }, - "interfaces": {} + "interfaces": {}, + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } } diff --git a/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json index 29e11388382c..4c0acf7eb890 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h4-r0/platform.json @@ -495,5 +495,9 @@ } ] }, - "interfaces": {} + "interfaces": {}, + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } } diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json index b40c5fe9498d..99562f3deb5a 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json @@ -447,5 +447,10 @@ } ] }, - "interfaces": {} + "interfaces": {}, + + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } } diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json index 63f55d3eb01a..b330c66ff380 100644 --- a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json @@ -460,5 +460,9 @@ } ] }, - "interfaces": {} + "interfaces": {}, + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } } diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json index ab881c4ccfdd..4d34218672e9 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json @@ -275,5 +275,9 @@ } ] }, - "interfaces": {} + "interfaces": {}, + "asic_sensors": { + "poll_interval": "10", + "poll_admin_status": "enable" + } } diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index ae5c249b7535..4c042b14e232 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1,8 +1,6 @@ # SONiC Configuration Database Manual + **Table of Contents** -======= -Table of Contents -================= * [Introduction](#introduction) * [Configuration](#configuration) diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 1a750faa6903..39efe5c842df 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -208,7 +208,7 @@ def run(self): './yang-models/sonic-xcvrd-log.yang', './yang-models/sonic-grpcclient.yang', './yang-models/sonic-serial-console.yang', - './yang-models/sonic-smart-switch.yang']), + './yang-models/sonic-smart-switch.yang',]), ('cvlyang-models', ['./cvlyang-models/sonic-acl.yang', './cvlyang-models/sonic-banner.yang', './cvlyang-models/sonic-bgp-common.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 8629c64e10cd..67999dd9de4d 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2793,14 +2793,6 @@ "retention_period": "15" } }, - "ASIC_SENSORS": { - "ASIC_SENSORS_POLLER_INTERVAL": { - "interval": "10" - }, - "ASIC_SENSORS_POLLER_STATUS": { - "admin_status": "enable" - } - }, "ASIC_SENSORS": { "ASIC_SENSORS_POLLER_INTERVAL": { "interval": "10" From 6c870485233c30e7b447b35b3ef4843f6426e1be Mon Sep 17 00:00:00 2001 From: mlok Date: Fri, 20 Dec 2024 14:46:53 -0500 Subject: [PATCH 09/10] Fixed VS test failure --- src/sonic-config-engine/asic_sensors_config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sonic-config-engine/asic_sensors_config.py b/src/sonic-config-engine/asic_sensors_config.py index d10cdb3b9431..49ed513d0ff9 100644 --- a/src/sonic-config-engine/asic_sensors_config.py +++ b/src/sonic-config-engine/asic_sensors_config.py @@ -25,6 +25,10 @@ def get_asic_sensors_config(): else: platform_path = device_info.get_path_to_platform_dir() json_file = os.path.join(platform_path, device_info.PLATFORM_JSON_FILE) + + if not os.path.exists(json_file): + return config + platform_json = portconfig.readJson(json_file) if not platform_json: return config From d7a69204107351ac535a427b0e3d6783b72a74bb Mon Sep 17 00:00:00 2001 From: mlok Date: Mon, 23 Dec 2024 10:47:41 -0500 Subject: [PATCH 10/10] address review comment: import get_asic_sensors_config --- src/sonic-config-engine/sonic-cfggen | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index aed7a936eef0..37f6942428b6 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -36,7 +36,7 @@ from portconfig import get_port_config, get_breakout_mode from sonic_py_common.multi_asic import get_asic_id_from_name, get_asic_device_id, is_multi_asic from sonic_py_common import device_info from swsscommon.swsscommon import ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector -import asic_sensors_config +from asic_sensors_config import get_asic_sensors_config PY3x = sys.version_info >= (3, 0) @@ -462,9 +462,9 @@ def main(): asic_sensors = {} if is_multi_asic(): if asic_name is not None: - asic_sensors = asic_sensors_config.get_asic_sensors_config() + asic_sensors = get_asic_sensors_config() else: - asic_sensors = asic_sensors_config.get_asic_sensors_config() + asic_sensors = get_asic_sensors_config() if asic_sensors: deep_update(data, asic_sensors)