Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlodek committed Jun 4, 2024
1 parent 0a6e2a1 commit 0289178
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/pandablocks_ioc/_hdf_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,6 @@ async def _update_directory_path(self, new_val) -> None:

logging.debug(f"Need to create {dirs_to_create} directories.")

# Default message is "OK"
status_msg = "OK"

# Case where all dirs exist
if dirs_to_create == 0:
if os.access(new_path, os.W_OK):
Expand All @@ -617,12 +614,11 @@ async def _update_directory_path(self, new_val) -> None:
status_msg = f"Need to create {dirs_to_create} > {max_dirs_to_create} dirs."
self._directory_exists_record.set(0)

sevr = alarm.NO_ALARM
alrm = alarm.NO_ALARM
if self._directory_exists_record.get() == 0:
sevr = alarm.MAJOR_ALARM, alrm = alarm.STATE_ALARM
logging.error(status_msg)

Check warning on line 619 in src/pandablocks_ioc/_hdf_ioc.py

View check run for this annotation

Codecov / codecov/patch

src/pandablocks_ioc/_hdf_ioc.py#L619

Added line #L619 was not covered by tests
else:
sevr = alarm.NO_ALARM, alrm = alarm.NO_ALARM
logging.debug(status_msg)

Check warning on line 622 in src/pandablocks_ioc/_hdf_ioc.py

View check run for this annotation

Codecov / codecov/patch

src/pandablocks_ioc/_hdf_ioc.py#L622

Added line #L622 was not covered by tests

self._status_message_record.set(status_msg, severity=sevr, alarm=alrm)

Check warning on line 624 in src/pandablocks_ioc/_hdf_ioc.py

View check run for this annotation

Codecov / codecov/patch

src/pandablocks_ioc/_hdf_ioc.py#L624

Added line #L624 was not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hdf_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ async def test_hdf5_file_writing_last_n_endreason_not_ok(

# Initially Status should be "Dir exists and is writable"
val = await caget(hdf5_test_prefix + ":Status", datatype=DBR_CHAR_STR)
assert val == "Dir exists and is writable"
assert val == "OK"

await caput(hdf5_test_prefix + ":Capture", 1, wait=True, timeout=TIMEOUT)

Expand Down

0 comments on commit 0289178

Please sign in to comment.