def __init__(self): try: import ceph except ImportError: raise ImportError('Please install ceph to enable CephBackend.') self._client = ceph.S3Client()
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
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
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
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