From b146d722f445aa2f6ad62df2bc73f19ac13d10f3 Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan Date: Sat, 25 May 2024 07:55:37 +0000 Subject: [PATCH] Fixed a bug that was causing sync-to-disk to fail --- sonic-stormond/scripts/stormond | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sonic-stormond/scripts/stormond b/sonic-stormond/scripts/stormond index aa858b260..6901bfe03 100755 --- a/sonic-stormond/scripts/stormond +++ b/sonic-stormond/scripts/stormond @@ -122,7 +122,7 @@ class DaemonStorage(daemon_base.DaemonBase): self.fsio_json_file_loaded = True except Exception as e: - self.log_error("JSON file could not be loaded: {}".format(e)) + self.log_error("JSON file could not be loaded: {}".format(str(e))) return @@ -132,7 +132,7 @@ class DaemonStorage(daemon_base.DaemonBase): self.log_info("Syncing total and latest procfs reads and writes from STATE_DB to JSON file") - json_file_dict = {} + json_file_dict = {disk:{} for disk in self.storage.devices} try: for device in self.storage.devices: for field in self.statedb_json_sync_fields: @@ -146,7 +146,7 @@ class DaemonStorage(daemon_base.DaemonBase): self.state_db.hset("{}|{}".format(STORAGE_DEVICE_TABLE,FSSTATS_SYNC_TIME_KEY), "successful_sync_time", str(self.fsio_sync_time)) except Exception as ex: - self.log_error("Unable to sync state_db to disk: {}".format(ex)) + self.log_error("Unable to sync state_db to disk: {}".format(str(ex))) # Run a sanity check on the state_db. If successful, get total, latest # FSIO reads and writes for each storage device from STATE_DB @@ -171,7 +171,7 @@ class DaemonStorage(daemon_base.DaemonBase): self.statedb_storage_info_loaded = True except Exception as e: - self.log_error("Reading STATE_DB failed with: {}".format(e)) + self.log_error("Reading STATE_DB failed with: {}".format(str(e))) def _determine_sot(self):