Skip to content

Commit

Permalink
Clean-up code/resolve linting errors for missed unused variables and …
Browse files Browse the repository at this point in the history
…for long lines
  • Loading branch information
doulikecookiedough committed Oct 1, 2024
1 parent 6256bcb commit fe5e7db
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/hashstore/filehashstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,6 @@ def delete_object(self, pid: str) -> None:
# Storing and deleting objects are synchronized together
# Duplicate store object requests for a pid are rejected, but deleting an object
# will wait for a pid to be released if it's found to be in use before proceeding.
sync_begin_debug_msg = f"Pid ({pid}) to locked list."
sync_wait_msg = f"Pid ({pid}) is locked. Waiting."

try:
# Before we begin deletion process, we look for the `cid` by calling
Expand Down Expand Up @@ -983,7 +981,10 @@ def delete_metadata(self, pid: str, format_id: Optional[str] = None) -> None:
try:
full_path_without_directory = Path(self.metadata / rel_path / pid_doc)
self._delete("metadata", full_path_without_directory)
info_string = f"Successfully deleted metadata for pid: {pid} for format_id: {format_id}"
info_string = (
f"Deleted metadata for pid: {pid} for format_id: {format_id}"
)

self.fhs_logger.info(info_string)
finally:
# Release pid
Expand Down Expand Up @@ -1774,7 +1775,9 @@ def _mark_pid_refs_file_for_deletion(
delete_list.append(self._rename_path_for_deletion(pid_refs_path))

except Exception as e:
err_msg = f"Unable to delete pid refs file: {pid_refs_path} for pid: {pid}. Details: {e}"
err_msg = (
f"Unable to delete pid refs file: {pid_refs_path} for pid: {pid}. {e}"
)
self.fhs_logger.error(err_msg)

def _remove_pid_and_handle_cid_refs_deletion(
Expand Down Expand Up @@ -2027,7 +2030,9 @@ def _verify_hashstore_references(
:param path cid_refs_path: Path to cid refs file
:param str additional_log_string: String to append to exception statement
"""
debug_msg = f"Verifying pid ({pid}) and cid ({cid}) refs files. Note: {additional_log_string}"
debug_msg = (
f"Verifying pid ({pid}) and cid ({cid}) refs files. {additional_log_string}"
)
self.fhs_logger.debug(debug_msg)
if pid_refs_path is None:
pid_refs_path = self._get_hashstore_pid_refs_path(pid)
Expand Down

0 comments on commit fe5e7db

Please sign in to comment.