[ARVADOS] updated: a64415481a9bf4aa7bd1a21448455a991eb61e15
git at public.curoverse.com
git at public.curoverse.com
Thu Jan 8 21:51:13 EST 2015
Summary of changes:
services/fuse/arvados_fuse/__init__.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
via a64415481a9bf4aa7bd1a21448455a991eb61e15 (commit)
from d3c48a18b7ac4e8f0bbdd2b9d56f2c629af7e89f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit a64415481a9bf4aa7bd1a21448455a991eb61e15
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Jan 8 21:52:42 2015 -0500
4904: Can now read from .arvados#project to trigger update of project directory
contents.
diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 148a9a6..4b2e0ad 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -129,6 +129,8 @@ class File(FreshBase):
def mtime(self):
return self._mtime
+ def opening(self):
+ pass
class StreamReaderFile(File):
'''Wraps a StreamFileReader as a file.'''
@@ -172,6 +174,13 @@ class ObjectFile(StringFile):
self._mtime = convertTime(obj['modified_at']) if 'modified_at' in obj else 0
self.contents = json.dumps(obj, indent=4, sort_keys=True) + "\n"
+class UpdateOnOpenFile(ObjectFile):
+ def __init__(self, parent_inode, obj, parent_dir):
+ super(UpdateOnOpenFile, self).__init__(parent_inode, obj)
+ self.parent_dir = parent_dir
+
+ def opening(self):
+ self.parent_dir.update()
class Directory(FreshBase):
'''Generic directory object, backed by a dict.
@@ -546,7 +555,7 @@ class ProjectDirectory(Directory):
def update(self):
if self.project_object_file == None:
- self.project_object_file = ObjectFile(self.inode, self.project_object)
+ self.project_object_file = UpdateOnOpenFile(self.inode, self.project_object, self)
self.inodes.add_entry(self.project_object_file)
def namefn(i):
@@ -819,6 +828,8 @@ class Operations(llfuse.Operations):
if isinstance(p, Directory):
raise llfuse.FUSEError(errno.EISDIR)
+ p.opening()
+
fh = self._filehandles_counter
self._filehandles_counter += 1
self._filehandles[fh] = FileHandle(fh, p)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list