Skip to content

Commit

Permalink
Fixed a bug that was causing sync-to-disk to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
assrinivasan committed May 25, 2024
1 parent b2ec903 commit b146d72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sonic-stormond/scripts/stormond
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit b146d72

Please sign in to comment.