3644: Tested, fixed various mount modes.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 3 Sep 2014 19:55:06 +0000 (15:55 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 3 Sep 2014 19:55:06 +0000 (15:55 -0400)
services/fuse/arvados_fuse/__init__.py
services/fuse/bin/arv-mount

index fd5463a35666fa4368c6c3a44cf6edf0a63be58b..6d55b3481e14b09012b00455eca8116cbc27625e 100644 (file)
@@ -257,8 +257,8 @@ class CollectionDirectory(Directory):
 
     def update(self):
         try:
 
     def update(self):
         try:
-            if re.match(r'^[a-f0-9]{32}', self.collection_locator):
-                return
+            if self.collection_object is not None and re.match(r'^[a-f0-9]{32}', self.collection_locator):
+                return True
             #with llfuse.lock_released:
             new_collection_object = self.api.collections().get(uuid=self.collection_locator).execute()
             if "portable_data_hash" not in new_collection_object:
             #with llfuse.lock_released:
             new_collection_object = self.api.collections().get(uuid=self.collection_locator).execute()
             if "portable_data_hash" not in new_collection_object:
@@ -289,6 +289,7 @@ class CollectionDirectory(Directory):
                     for k, v in s.files().items():
                         cwd._entries[sanitize_filename(k)] = self.inodes.add_entry(StreamReaderFile(cwd.inode, v, self.ctime(), self.mtime()))
             self.fresh()
                     for k, v in s.files().items():
                         cwd._entries[sanitize_filename(k)] = self.inodes.add_entry(StreamReaderFile(cwd.inode, v, self.ctime(), self.mtime()))
             self.fresh()
+            return True
         except Exception as detail:
             _logger.error("arv-mount %s: error", self.collection_locator)
             _logger.exception(detail)
         except Exception as detail:
             _logger.error("arv-mount %s: error", self.collection_locator)
             _logger.exception(detail)
index db700368756b584c779904640aa3053cc09db9ec..89acdd6af7c724ac804ecdf168efd7d1a3658984 100755 (executable)
@@ -88,21 +88,23 @@ with "--".
         operations = Operations(os.getuid(), os.getgid())
         api = arvados.api('v1')
 
         operations = Operations(os.getuid(), os.getgid())
         api = arvados.api('v1')
 
+        usr = api.users().current().execute()
         if args.by_hash:
             # Set up the request handler with the 'magic directory' at the root
             operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes, api))
         elif args.by_tag:
             operations.inodes.add_entry(TagsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
         elif args.shared:
         if args.by_hash:
             # Set up the request handler with the 'magic directory' at the root
             operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes, api))
         elif args.by_tag:
             operations.inodes.add_entry(TagsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
         elif args.shared:
-            operations.inodes.add_entry(SharedDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+            operations.inodes.add_entry(SharedDirectory(llfuse.ROOT_INODE, operations.inodes, api, usr))
+        elif args.home:
+            operations.inodes.add_entry(ProjectDirectory(llfuse.ROOT_INODE, operations.inodes, api, usr))
         elif args.collection != None:
             # Set up the request handler with the collection at the root
         elif args.collection != None:
             # Set up the request handler with the collection at the root
-            operations.inodes.add_entry(CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, args.collection))
-        elif args.project != None:
-            operations.inodes.add_entry(ProjectDirectory(llfuse.ROOT_INODE, operations.inodes, args.project))
+            operations.inodes.add_entry(CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, api, args.collection))
+        elif args.project != None:            
+            operations.inodes.add_entry(ProjectDirectory(llfuse.ROOT_INODE, operations.inodes, api, api.groups().get(uuid=args.project).execute()))
         else:
             e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE))
         else:
             e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE))
-            usr = api.users().current().execute()
             e._entries['home'] = operations.inodes.add_entry(ProjectDirectory(e.inode, operations.inodes, api, usr))
             e._entries['shared'] = operations.inodes.add_entry(SharedDirectory(e.inode, operations.inodes, api, usr))
             e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(e.inode, operations.inodes, api))
             e._entries['home'] = operations.inodes.add_entry(ProjectDirectory(e.inode, operations.inodes, api, usr))
             e._entries['shared'] = operations.inodes.add_entry(SharedDirectory(e.inode, operations.inodes, api, usr))
             e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(e.inode, operations.inodes, api))