Skip to content

Commit

Permalink
Refactor get_user_based_object_store to get_user_objectstore.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Feb 20, 2019
1 parent b4730cd commit 14cd0a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def create(self, obj, **kwargs):
kwargs.get('plugged_media', None),
enough_quota_on_instance_level_media=kwargs.get("enough_quota_on_instance_level_media", False))
if plugged_media is not None:
store = get_user_based_object_store(self.config, plugged_media)
store = get_user_objectstore(self.config, plugged_media)
store.create(obj, **kwargs)
plugged_media.association_with_dataset(obj)
else:
Expand Down Expand Up @@ -615,7 +615,7 @@ def _call_method(self, method, obj, default, default_is_exception, **kwargs):
kwargs.get('plugged_media', None),
enough_quota_on_instance_level_media=kwargs.get("enough_quota_on_instance_level_media", False))
if plugged_media is not None:
store = get_user_based_object_store(self.config, plugged_media)
store = get_user_objectstore(self.config, plugged_media)
for k, s in self.backends.items():
if s.exists(obj, **kwargs):
store.dataset_staging_path = s.get_filename(obj)
Expand Down Expand Up @@ -877,7 +877,7 @@ def exists(self, obj, **kwargs):
plugged_media = kwargs.get('plugged_media', None)
if plugged_media is not None:
for pm in plugged_media:
store = get_user_based_object_store(self.config, pm)
store = get_user_objectstore(self.config, pm)
for s in self.backends.values():
if s.exists(obj, **kwargs):
store.dataset_staging_path = s.get_filename(obj)
Expand Down Expand Up @@ -911,7 +911,7 @@ def create(self, obj, user=None, plugged_media=None, **kwargs):
if chosen_plugged_media is not None:
chosen_plugged_media.dataset_staging_path = self.backends[0].get_filename(obj)
from_order = chosen_plugged_media.order
store = get_user_based_object_store(self.config, chosen_plugged_media)
store = get_user_objectstore(self.config, chosen_plugged_media)
store.create(obj, **kwargs)
chosen_plugged_media.association_with_dataset(obj)
chosen_plugged_media.set_usage(chosen_plugged_media.usage + dataset_size)
Expand Down Expand Up @@ -1063,7 +1063,7 @@ def pick_a_plugged_media(plugged_media, from_order=None, dataset_size=0, enough_
raise Exception("User does not have enough quota to persist the dataset.")


def get_user_based_object_store(config, plugged_media):
def get_user_objectstore(config, plugged_media):
categories = plugged_media.__class__.categories
if plugged_media.category == categories.LOCAL:
return DiskObjectStore(config=config, config_dict={"files_dir": plugged_media.path})
Expand Down

0 comments on commit 14cd0a6

Please sign in to comment.