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)
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
def get_object(self, key): try: return deepcopy(self._data[key]) except KeyError: raise exception.BankGetObjectFailed('no such object')
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)