[ARVADOS] updated: 7b877a2be249c5e4ab9ab5d73cb68906ca3113d8

git at public.curoverse.com git at public.curoverse.com
Mon Feb 16 10:09:31 EST 2015


Summary of changes:
 services/fuse/arvados_fuse/__init__.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

       via  7b877a2be249c5e4ab9ab5d73cb68906ca3113d8 (commit)
      from  4106786a571e8d919e474d8ae205c3b2c9042b26 (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 7b877a2be249c5e4ab9ab5d73cb68906ca3113d8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Feb 16 10:11:42 2015 -0500

    5095: Set _mtime when the collection object is updated.

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 0a14fe2..8c19c31 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -65,7 +65,9 @@ class SafeApi(object):
 
 
 def convertTime(t):
-    '''Parse Arvados timestamp to unix time.'''
+    """Parse Arvados timestamp to unix time."""
+    if not t:
+        return 0
     try:
         return calendar.timegm(time.strptime(t, "%Y-%m-%dT%H:%M:%SZ"))
     except (TypeError, ValueError):
@@ -301,7 +303,7 @@ class CollectionDirectory(Directory):
         self.collection_object = None
         if isinstance(collection, dict):
             self.collection_locator = collection['uuid']
-            self._mtime = convertTime(collection['modified_at']) if 'modified_at' in collection else 0
+            self._mtime = convertTime(collection.get('modified_at'))
         else:
             self.collection_locator = collection
 
@@ -318,6 +320,8 @@ class CollectionDirectory(Directory):
     def new_collection(self, new_collection_object, coll_reader):
         self.collection_object = new_collection_object
 
+        self._mtime = convertTime(self.collection_object.get('modified_at'))
+
         if self.collection_object_file is not None:
             self.collection_object_file.update(self.collection_object)
 
@@ -391,9 +395,6 @@ class CollectionDirectory(Directory):
         else:
             return super(CollectionDirectory, self).__contains__(k)
 
-    def mtime(self):
-        return convertTime(self.collection_object["modified_at"]) if self.collection_object is not None and 'modified_at' in self.collection_object else self._mtime
-
 
 class MagicDirectory(Directory):
     '''A special directory that logically contains the set of all extant keep

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list