コード例 #1
0
 def get_object(self, key, context=None):
     try:
         return self._get_object(container=self.bank_object_container,
                                 obj=key)
     except SwiftConnectionFailed as err:
         LOG.error("get object failed, err: %s.", err)
         raise exception.BankGetObjectFailed(reason=err, key=key)
コード例 #2
0
 def get_object(self, key):
     LOG.debug("FsBank: get_object. key: %s", key)
     self._validate_path(key)
     try:
         data = self._get_object(path=key)
     except OSError as err:
         LOG.error("Get object failed. err: %s", err)
         raise exception.BankGetObjectFailed(reason=err, key=key)
     if isinstance(data, six.string_types):
         try:
             data = jsonutils.loads(data)
         except ValueError:
             pass
     return data
コード例 #3
0
 def get_object(self, key):
     try:
         return deepcopy(self._data[key])
     except KeyError:
         raise exception.BankGetObjectFailed('no such object')
コード例 #4
0
ファイル: s3_bank_plugin.py プロジェクト: thuylt2/karbor
 def get_object(self, key):
     try:
         return self._get_object(bucket=self.bank_object_bucket, obj=key)
     except S3ConnectionFailed as err:
         LOG.error("get object failed, err: %s.", err)
         raise exception.BankGetObjectFailed(reason=err, key=key)