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

Fix logging in export_history.py, fix Azure and S3 tests #19542

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions lib/galaxy/model/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
TYPE_CHECKING,
Union,
)
from urllib.parse import urlparse

from bdbag import bdbag_api as bdb
from boltons.iterutils import remap
Expand Down Expand Up @@ -2659,11 +2658,10 @@ def _finalize(self):
# upload output file to file source
if not self.file_sources:
raise Exception(f"Need self.file_sources but {type(self)} is missing it: {self.file_sources}.")
file_source_uri = urlparse(str(self.file_source_uri))
file_source_path = self.file_sources.get_file_source_path(self.file_source_uri)
file_source = file_source_path.file_source
assert os.path.exists(self.out_file)
self.file_source_uri = f"{file_source_uri.scheme}://{file_source_uri.netloc}" + file_source.write_from(
self.file_source_uri = f"{file_source.get_scheme()}://{file_source.get_prefix()}" + file_source.write_from(
file_source_path.path, self.out_file, user_context=self.user_context
Comment on lines -2662 to 2665
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't have any effect.

)
shutil.rmtree(self.temp_output_dir)
Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/tools/imp_exp/export_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def _write_to_destination(file_sources_path: str, out_file: str, destination_uri
file_source_path = file_sources.get_file_source_path(destination_uri)
file_source = file_source_path.file_source
assert os.path.exists(out_file)
return file_source.write_from(file_source_path.path, out_file)
return f"{file_source.get_scheme()}://{file_source.get_prefix()}" + file_source.write_from(
file_source_path.path, out_file
)


def get_file_sources(file_sources_path: str) -> ConfiguredFileSources:
Expand Down
5 changes: 4 additions & 1 deletion test/unit/files/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ def write_from(
user_context: OptionalUserContext = None,
) -> str:
file_source_path = file_sources.get_file_source_path(uri)
file_source = file_source_path.file_source
with tempfile.NamedTemporaryFile(mode="w") as f:
f.write(content)
f.flush()
return file_source_path.file_source.write_from(file_source_path.path, f.name, user_context=user_context)
return f"{file_source.get_scheme()}://{file_source.get_prefix()}" + file_source.write_from(
file_source_path.path, f.name, user_context=user_context
)


def configured_file_sources(conf_file, file_sources_config: Optional[FileSourcePluginsConfig] = None):
Expand Down
Loading