Skip to content

Commit

Permalink
fixes to reset failed bps_submit_jobs gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Nov 20, 2024
1 parent 5681153 commit 1259695
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lsst/cmservice/common/butler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Utility functions for working with butler commands"""

from lsst.cmservice.common import errors
from lsst.daf.butler import Butler
from lsst.daf.butler import Butler, MissingCollectionError


def remove_run_collections(
Expand Down Expand Up @@ -31,6 +31,8 @@ def remove_run_collections(
raise errors.CMNoButlerError(e) from e # pragma: no cover
try: # pragma: no cover
butler.registry.removeCollection(collection_name)
except MissingCollectionError:
pass
except Exception as msg:
raise errors.CMButlerCallError(msg) from msg

Expand Down
2 changes: 1 addition & 1 deletion src/lsst/cmservice/handlers/script_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ async def _reset_script(
if script.stamp_url and os.path.exists(script.stamp_url):
os.unlink(script.stamp_url)
if to_status.value <= StatusEnum.ready.value:
if script.script_url:
if script.script_url and os.path.exists(script.script_url):
os.unlink(script.script_url)
update_fields["script_url"] = None
update_fields["log_url"] = None
Expand Down

0 comments on commit 1259695

Please sign in to comment.