Skip to content

Commit

Permalink
Ensure output directory exists
Browse files Browse the repository at this point in the history
If the caller passed a directory name that doesn't exist, the subsequent call to write_fits was failing.
  • Loading branch information
dhirving committed Feb 1, 2024
1 parent fe592e9 commit b80daee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/lsst/image_cutout_backend/_image_cutout_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def write_fits(self, extract_result: Extraction) -> ResourcePath:
output_uuid = uuid4()
remote_uri = self.output_root.join(output_uuid.hex + ".fits")
with ResourcePath.temporary_uri(prefix=self.temporary_root, suffix=".fits") as tmp_uri:
tmp_uri.parent().mkdir()
extract_result.write_fits(tmp_uri.ospath)
remote_uri.transfer_from(tmp_uri, transfer="copy")
return remote_uri

0 comments on commit b80daee

Please sign in to comment.