From db735d5927f72c74cc7a23c0207c85894d9d13fd Mon Sep 17 00:00:00 2001 From: "kanza.latif" Date: Thu, 19 Sep 2024 16:12:00 +0500 Subject: [PATCH] errors --- scripts/hostcfgd | 6 +++--- tests/hostcfgd/hostcfgd_test.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/hostcfgd b/scripts/hostcfgd index 7a591743..b8427d5d 100644 --- a/scripts/hostcfgd +++ b/scripts/hostcfgd @@ -1747,7 +1747,7 @@ class Memory_StatisticsCfg(object): # Apply default configurations if not present for row, value in self.memory_statistics_defaults.items(): if not memory_statistics_conf.get(row): - self.config_db.mod_entry("MEMORY_STATISTICS", "config", {row: value}) + self.config_db.mod_entry("MEMORY_STATISTICS_TABLE", "config", {row: value}) # Apply configurations to ensure they are set correctly on startup self.apply_configuration(memory_statistics_conf) @@ -1896,7 +1896,7 @@ class HostConfigDaemon: ldap_server = init_data['LDAP_SERVER'] lpbk_table = init_data['LOOPBACK_INTERFACE'] kdump = init_data['KDUMP'] - memory_statistics = init_data['MEMORY_STATISTICS'] + memory_statistics = init_data['MEMORY_STATISTICS_TABLE'] passwh = init_data['PASSW_HARDENING'] ssh_server = init_data['SSH_SERVER'] dev_meta = init_data.get(swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, {}) @@ -2100,7 +2100,7 @@ class HostConfigDaemon: return callback self.config_db.subscribe('KDUMP', make_callback(self.kdump_handler)) - self.config_db.subscribe('MEMORY_STATISTICS', make_callback(self.memory_statistics_handler)) + self.config_db.subscribe('MEMORY_STATISTICS_TABLE', make_callback(self.memory_statistics_handler)) # Handle AAA, TACACS and RADIUS related tables self.config_db.subscribe('AAA', make_callback(self.aaa_handler)) self.config_db.subscribe('TACPLUS', make_callback(self.tacacs_global_handler)) diff --git a/tests/hostcfgd/hostcfgd_test.py b/tests/hostcfgd/hostcfgd_test.py index 449675b6..3dbe905b 100644 --- a/tests/hostcfgd/hostcfgd_test.py +++ b/tests/hostcfgd/hostcfgd_test.py @@ -324,12 +324,12 @@ def test_mgmtiface_event(self): call(['cat', '/proc/net/route'], ['grep', '-E', r"eth0\s+00000000\s+[0-9A-Z]+\s+[0-9]+\s+[0-9]+\s+[0-9]+\s+202"], ['wc', '-l']) ] mocked_check_output.assert_has_calls(expected) - + def test_memory_statistics_event(self): MockConfigDb.set_config_db(HOSTCFG_DAEMON_CFG_DB) daemon = hostcfgd.HostConfigDaemon() daemon.register_callbacks() - MockConfigDb.event_queue = [('MEMORY_STATISTICS', 'config')] + MockConfigDb.event_queue = [('MEMORY_STATISTICS_TABLE', 'config')] with mock.patch('hostcfgd.subprocess') as mocked_subprocess: popen_mock = mock.Mock()