Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-46307: execute butler housekeeping scripts at remote DF for multisite processing #46

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/DM-46307.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modified the function responsible for replacing placeholders in command line arguments so it gracefully handles the case when there are no placeholders to replace.
10 changes: 5 additions & 5 deletions python/lsst/ctrl/bps/htcondor/htcondor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,12 +957,12 @@
arguments : `str`
Given arguments string with placeholders replaced.
"""
replacements = gwjob.cmdvals if gwjob.cmdvals is not None else {}

Check warning on line 960 in python/lsst/ctrl/bps/htcondor/htcondor_service.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/bps/htcondor/htcondor_service.py#L960

Added line #L960 was not covered by tests
try:
arguments = arguments.format(**gwjob.cmdvals)
except (KeyError, TypeError): # TypeError in case None instead of {}
_LOG.error(
"Could not replace command variables:\narguments: %s\ncmdvals: %s", arguments, gwjob.cmdvals
)
arguments = arguments.format(**replacements)
except KeyError as exc:
_LOG.error("Could not replace command variables: replacement for %s not provided", str(exc))
_LOG.debug("arguments: %s\ncmdvals: %s", arguments, replacements)

Check warning on line 965 in python/lsst/ctrl/bps/htcondor/htcondor_service.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/bps/htcondor/htcondor_service.py#L962-L965

Added lines #L962 - L965 were not covered by tests
raise
return arguments

Expand Down
Loading