Skip to content

Commit

Permalink
errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kanza-latif committed Sep 19, 2024
1 parent efcae92 commit db735d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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, {})
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tests/hostcfgd/hostcfgd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit db735d5

Please sign in to comment.