Skip to content

Commit

Permalink
Redo logging to be more precise in warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek authored and hexylena committed Mar 19, 2018
1 parent 8d26be7 commit 75465de
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,21 +656,22 @@ def _call_method(self, method, obj, default, default_is_exception, **kwargs):
return default

def __get_store_id_for(self, obj, **kwargs):
if obj.object_store_id is not None and obj.object_store_id in self.backends:
return obj.object_store_id
else:
# if this instance has been switched from a non-distributed to a
# distributed object store, or if the object's store id is invalid,
# try to locate the object
log.debug('The backend object store ID (%s) for %s object with ID %s is invalid'
% (obj.object_store_id, obj.__class__.__name__, obj.id))
for id, store in self.backends.items():
if store.exists(obj, **kwargs):
log.warning('%s object with ID %s found in backend object store with ID %s'
% (obj.__class__.__name__, obj.id, id))
obj.object_store_id = id
_create_object_in_session(obj)
return id
if obj.object_store_id is not None:
if obj.object_store_id in self.backends:
return obj.object_store_id
else:
log.warning('The backend object store ID (%s) for %s object with ID %s is invalid'
% (obj.object_store_id, obj.__class__.__name__, obj.id))
# if this instance has been switched from a non-distributed to a
# distributed object store, or if the object's store id is invalid,
# try to locate the object
for id, store in self.backends.items():
if store.exists(obj, **kwargs):
log.warning('%s object with ID %s found in backend object store with ID %s'
% (obj.__class__.__name__, obj.id, id))
obj.object_store_id = id
_create_object_in_session(obj)
return id
return None


Expand Down

0 comments on commit 75465de

Please sign in to comment.