Merge branch 'master' into 4823-python-sdk-writable-collection-api
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 17 Feb 2015 17:16:14 +0000 (12:16 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 17 Feb 2015 17:16:14 +0000 (12:16 -0500)
1  2 
sdk/python/arvados/commands/put.py
services/fuse/arvados_fuse/__init__.py

Simple merge
index 112e48d180bf1f1419aff44ec2a8d67ad14c32f5,71c4ee5a2c4b713aba669a51605f01736b02bfe0..6850de66cc111982d3048068df32a4171bb6c1e5
@@@ -30,8 -30,44 +30,10 @@@ _logger = logging.getLogger('arvados.ar
  # appear as underscores in the fuse mount.)
  _disallowed_filename_characters = re.compile('[\x00/]')
  
 -class SafeApi(object):
 -    """Threadsafe wrapper for API object.
 -
 -    This stores and returns a different api object per thread, because
 -    httplib2 which underlies apiclient is not threadsafe.
 -    """
 -
 -    def __init__(self, config):
 -        self.host = config.get('ARVADOS_API_HOST')
 -        self.api_token = config.get('ARVADOS_API_TOKEN')
 -        self.insecure = config.flag_is_true('ARVADOS_API_HOST_INSECURE')
 -        self.local = threading.local()
 -        self.block_cache = arvados.KeepBlockCache()
 -
 -    def localapi(self):
 -        if 'api' not in self.local.__dict__:
 -            self.local.api = arvados.api(
 -                version='v1',
 -                host=self.host, token=self.api_token, insecure=self.insecure)
 -        return self.local.api
 -
 -    def localkeep(self):
 -        if 'keep' not in self.local.__dict__:
 -            self.local.keep = arvados.KeepClient(api_client=self.localapi(), block_cache=self.block_cache)
 -        return self.local.keep
 -
 -    def __getattr__(self, name):
 -        # Proxy nonexistent attributes to the local API client.
 -        try:
 -            return getattr(self.localapi(), name)
 -        except AttributeError:
 -            return super(SafeApi, self).__getattr__(name)
 -
 -
  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):