7661: rename MagiDirectory by_pdh as pdh_only
authorradhika <radhika@curoverse.com>
Mon, 9 Nov 2015 16:21:35 +0000 (11:21 -0500)
committerradhika <radhika@curoverse.com>
Mon, 9 Nov 2015 16:21:35 +0000 (11:21 -0500)
services/fuse/arvados_fuse/fusedir.py
services/fuse/bin/arv-mount

index 5856888e0229e936aa2dfacbb1ab0dae5022dff2..c078242980a17d0d9e83a20821d84c8687960bd9 100644 (file)
@@ -496,11 +496,11 @@ point the collection will actually be looked up on the server and the directory
 will appear if it exists.
 """.lstrip()
 
-    def __init__(self, parent_inode, inodes, api, num_retries, by_pdh=False):
+    def __init__(self, parent_inode, inodes, api, num_retries, pdh_only=False):
         super(MagicDirectory, self).__init__(parent_inode, inodes)
         self.api = api
         self.num_retries = num_retries
-        self.by_pdh = by_pdh
+        self.pdh_only = pdh_only
 
     def __setattr__(self, name, value):
         super(MagicDirectory, self).__setattr__(name, value)
@@ -518,10 +518,7 @@ will appear if it exists.
         if k in self._entries:
             return True
 
-        if self.by_pdh and uuid_pattern.match(k):
-            raise llfuse.FUSEError(errno.ENOENT)
-
-        if not portable_data_hash_pattern.match(k) and not uuid_pattern.match(k):
+        if not portable_data_hash_pattern.match(k) and (self.pdh_only or not uuid_pattern.match(k)):
             return False
 
         try:
index e2df1c8da3b34c6e1126f8405c9ffc474aef040a..81f8ca6cd03f707733f5f989e57761b292a5fa5d 100755 (executable)
@@ -32,7 +32,7 @@ with "--".
 
     mount_mode = parser.add_mutually_exclusive_group()
 
-    mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_pdh, by_id (default).""")
+    mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_id (default).""")
     mount_mode.add_argument('--home', action='store_true', help="""Mount only the user's home project.""")
     mount_mode.add_argument('--shared', action='store_true', help="""Mount only list of projects shared with the user.""")
     mount_mode.add_argument('--by-tag', action='store_true',
@@ -132,7 +132,7 @@ with "--".
             e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE, operations.inodes))
             dir_args[0] = e.inode
 
-            e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args, by_pdh=True if args.by_pdh else False))
+            e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args, pdh_only=True if args.by_pdh else False))
 
             e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(*dir_args))