projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
21379: Follow rules for federated list queries.
[arvados.git]
/
tools
/
user-activity
/
arvados_user_activity
/
main.py
diff --git
a/tools/user-activity/arvados_user_activity/main.py
b/tools/user-activity/arvados_user_activity/main.py
index ded96c3121c0cc8d020b401c4e8b39da791bbdac..66d03b20410e009104e75cb2f1086e2c48adbf59 100755
(executable)
--- a/
tools/user-activity/arvados_user_activity/main.py
+++ b/
tools/user-activity/arvados_user_activity/main.py
@@
-96,6
+96,7
@@
collectionNameCache = {}
def getCollectionName(arv, uuid, pdh):
lookupField = uuid
filters = [["uuid", "=", uuid]]
def getCollectionName(arv, uuid, pdh):
lookupField = uuid
filters = [["uuid", "=", uuid]]
+ order = None
cached = uuid in collectionNameCache
# look up by uuid if it is available, fall back to look up by pdh
if uuid is None or len(uuid) != 27:
cached = uuid in collectionNameCache
# look up by uuid if it is available, fall back to look up by pdh
if uuid is None or len(uuid) != 27:
@@
-105,10
+106,11
@@
def getCollectionName(arv, uuid, pdh):
# name, if the uuid for the request is not known.
lookupField = pdh
filters = [["portable_data_hash", "=", pdh]]
# name, if the uuid for the request is not known.
lookupField = pdh
filters = [["portable_data_hash", "=", pdh]]
+ order = "created_at"
cached = pdh in collectionNameCache
if not cached:
cached = pdh in collectionNameCache
if not cached:
- u = arv.collections().list(filters=filters, order=
"created_at", limit=1
).execute().get("items")
+ u = arv.collections().list(filters=filters, order=
order, limit=1, count="none"
).execute().get("items")
if len(u) < 1:
return "(deleted)"
collectionNameCache[lookupField] = u[0]["name"]
if len(u) < 1:
return "(deleted)"
collectionNameCache[lookupField] = u[0]["name"]