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
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
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
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