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

Pass user to ObjectStorePopulator. #10223

Closed
Closed
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
2 changes: 1 addition & 1 deletion lib/galaxy/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ def _set_object_store_ids(self, job):
# jobs may have this set. Skip this following code if that is the case.
return

object_store_populator = ObjectStorePopulator(self.app)
object_store_populator = ObjectStorePopulator(self.app, job.user)
object_store_id = self.get_destination_configuration("object_store_id", None)
if object_store_id:
object_store_populator.object_store_id = object_store_id
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,10 @@ class ObjectStorePopulator:
datasets from a job end up with the same object_store_id.
"""

def __init__(self, app):
def __init__(self, app, user):
self.object_store = app.object_store
self.object_store_id = None
self.user = user

def set_object_store_id(self, data):
# Create an empty file immediately. The first dataset will be
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tools/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def execute(self, tool, trans, incoming=None, return_job=False, set_output_hid=T
# datasets first, then create the associations
parent_to_child_pairs = []
child_dataset_names = set()
object_store_populator = ObjectStorePopulator(app)
object_store_populator = ObjectStorePopulator(app, trans.user)
async_tool = tool.tool_type == 'data_source_async'

def handle_output(name, output, hidden=None):
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tools/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _create_output_dataset(self, **kwd):
**kwd
)
self.history.add_dataset(output_dataset)
ObjectStorePopulator(self.app).set_object_store_id(output_dataset)
ObjectStorePopulator(self.app, user=self.job.user).set_object_store_id(output_dataset)
return output_dataset

def _write_work_dir_file(self, filename, contents):
Expand Down