Example #1
0
    def __init__(self):
        try:
            import ceph
        except ImportError:
            raise ImportError('Please install ceph to enable CephBackend.')

        self._client = ceph.S3Client()
Example #2
0
 def __init__(self, path_mapping=None):
     try:
         import ceph
     except ImportError:
         raise ImportError('Please install ceph to enable CephBackend.')
     self._client = ceph.S3Client()
     assert (isinstance(path_mapping, dict) or (path_mapping is None))
     self.path_mapping = path_mapping
Example #3
0
    def __init__(self, path_mapping=None):
        try:
            import ceph
            warnings.warn('Ceph is deprecate in favor of Petrel.')
        except ImportError:
            raise ImportError('Please install ceph to enable CephBackend.')

        self._client = ceph.S3Client()
        assert isinstance(path_mapping, dict) or path_mapping is None
        self.path_mapping = path_mapping
Example #4
0
    def __init__(self, path_mapping=None):
        try:
            import ceph
        except ImportError:
            raise ImportError('Please install ceph to enable CephBackend.')

        warnings.warn(
            'CephBackend will be deprecated, please use PetrelBackend instead')
        self._client = ceph.S3Client()
        assert isinstance(path_mapping, dict) or path_mapping is None
        self.path_mapping = path_mapping
Example #5
0
 def __call__(self, path):
     s3client = ceph.S3Client()
     content = s3client.Get(path)
     return content
 def _ensure_ceph(self):
     if self.cclient is None:
         self.cclient = ceph.S3Client()
     return