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-37843: Fix bug when period in collection. #36

Merged
merged 1 commit into from
Feb 7, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/DM-37843.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the execution butler transfer bug when period in run collection.
13 changes: 9 additions & 4 deletions python/lsst/ctrl/bps/panda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def copy_files_for_distribution(files_to_stage, file_distribution_uri, max_copy_

# In case there are folders we iterate over its content
for local_pfn in files_to_stage.values():
folder_name = os.path.basename(local_pfn)
folder_name = os.path.basename(os.path.normpath(local_pfn))
if os.path.isdir(local_pfn):
files_in_folder = ResourcePath.findFileResources([local_pfn])
for file in files_in_folder:
Expand Down Expand Up @@ -415,9 +415,14 @@ def add_decoder_prefix(config, cmd_line, distribution_path, files):
# Manipulate file paths for placement on cmdline
files_plc_hldr = {}
for key, pfn in files[0].items():
files_plc_hldr[key] = os.path.basename(pfn)
_, extension = os.path.splitext(pfn)
if os.path.isdir(pfn) or (key == "butlerConfig" and not extension):
if pfn.endswith("/"):
files_plc_hldr[key] = os.path.basename(pfn[:-1])
isdir = True
else:
files_plc_hldr[key] = os.path.basename(pfn)
_, extension = os.path.splitext(pfn)
isdir = os.path.isdir(pfn) or (key == "butlerConfig" and extension != "yaml")
if isdir:
# this is needed to make isdir function working
# properly in ButlerURL instance on the egde node
files_plc_hldr[key] += "/"
Expand Down