Example #1
0
def check_volume(volume_path):
    meta = read_user_xattr(volume_path)
    namespace = meta.get(volume_xattr_keys['namespace'])
    address = meta.get(volume_xattr_keys['address'])
    if namespace is None or address is None:
        raise exc.OioException('Invalid rawx volume path')
    return namespace, address
Example #2
0
def read_chunk_metadata(fd):
    raw_meta = read_user_xattr(fd)
    meta = {}
    for k, v in chunk_xattr_keys.iteritems():
        if v not in raw_meta:
            raise exc.MissingAttribute(v)
        meta[k] = raw_meta[v]
    return meta
Example #3
0
def read_chunk_metadata(fd):
    raw_meta = read_user_xattr(fd)
    meta = {}
    for k, v in chunk_xattr_keys.iteritems():
        if v not in raw_meta:
            raise exc.MissingAttribute(v)
        meta[k] = raw_meta[v]
    return meta
Example #4
0
def check_volume(volume_path):
    meta = read_user_xattr(volume_path)
    server_type = meta.get(volume_xattr_keys['type'])
    if server_type != 'rawx':
        raise exc.OioException('Invalid volume path')
    namespace = meta.get(volume_xattr_keys['namespace'])
    server_id = meta.get(volume_xattr_keys['id'])
    if namespace is None or server_id is None:
        raise exc.OioException('Invalid rawx volume path')
    return namespace, server_id
Example #5
0
def check_volume(volume_path):
    meta = read_user_xattr(volume_path)
    server_type = meta.get(volume_xattr_keys['type'])
    if server_type != 'rawx':
        raise exc.OioException('Invalid volume path')
    namespace = meta.get(volume_xattr_keys['namespace'])
    server_id = meta.get(volume_xattr_keys['id'])
    if namespace is None or server_id is None:
        raise exc.OioException('Invalid rawx volume path')
    return namespace, server_id
Example #6
0
def check_volume(volume_path):
    meta = read_user_xattr(volume_path)
    server_type = meta.get(volume_xattr_keys["type"])
    if server_type != "rawx":
        raise exc.OioException("Invalid volume path")
    namespace = meta.get(volume_xattr_keys["namespace"])
    server_id = meta.get(volume_xattr_keys["id"])
    if namespace is None or server_id is None:
        raise exc.OioException("Invalid rawx volume path")
    return namespace, server_id