[ARVADOS] created: 8cf65d896e501c1c33eb4cf61a0dc18442904334
Git user
git at public.curoverse.com
Fri Jun 30 10:27:56 EDT 2017
at 8cf65d896e501c1c33eb4cf61a0dc18442904334 (commit)
commit 8cf65d896e501c1c33eb4cf61a0dc18442904334
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Jun 29 18:30:33 2017 -0400
11158: New behavior for project directories. Allow 'cd' into any collection or
subproject that exists on the server, even if it isn't returned in the listing.
Now applies listing limit, ordered by most recent. No longer lists other
object types (pipelines, links etc.)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curoverse.com>
diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index 0361ffe..c43afdd 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -742,6 +742,7 @@ class ProjectDirectory(Directory):
self._poll_time = poll_time
self._updating_lock = threading.Lock()
self._current_user = None
+ self._extra = set()
def want_event_subscribe(self):
return True
@@ -806,8 +807,19 @@ class ProjectDirectory(Directory):
self.project_object = self.api.users().get(
uuid=self.project_uuid).execute(num_retries=self.num_retries)
- contents = arvados.util.list_all(self.api.groups().contents,
- self.num_retries, uuid=self.project_uuid)
+ contents = self.api.groups().list(filters=[["owner_uuid", "=", self.project_uuid],
+ ["group_class", "=", "project"]],
+ limit=1000, order=["modified_at desc"]).execute(num_retries=self.num_retries)["items"]
+ contents.extend(self.api.collections().list(filters=[["owner_uuid", "=", self.project_uuid]],
+ limit=1000, order=["modified_at desc"]).execute(num_retries=self.num_retries)["items"])
+ if self._extra:
+ contents.extend(self.api.groups().list(filters=[["owner_uuid", "=", self.project_uuid],
+ ["group_class", "=", "project"],
+ ["uuid", "in", list(self._extra)]],
+ limit=1000).execute(num_retries=self.num_retries)["items"])
+ contents.extend(self.api.collections().list(filters=[["owner_uuid", "=", self.project_uuid],
+ ["uuid", "in", list(self._extra)]],
+ limit=1000).execute(num_retries=self.num_retries)["items"])
# end with llfuse.lock_released, re-acquire lock
@@ -830,7 +842,24 @@ class ProjectDirectory(Directory):
if k == '.arvados#project':
return True
else:
- return super(ProjectDirectory, self).__contains__(k)
+ if super(ProjectDirectory, self).__contains__(k):
+ return True
+ else:
+ with llfuse.lock_released:
+ contents = self.api.collections().list(filters=[["owner_uuid", "=", self.project_uuid],
+ ["name", "=", k]],
+ limit=1).execute(num_retries=self.num_retries)["items"]
+ if not contents:
+ contents = self.api.groups().list(filters=[["owner_uuid", "=", self.project_uuid],
+ ["group_class", "=", "project"],
+ ["name", "=", k]],
+ limit=1).execute(num_retries=self.num_retries)["items"]
+ if contents:
+ self._extra.add(contents[0]["uuid"])
+ self.invalidate()
+ return True
+ else:
+ return False
@use_counter
@check_update
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list