def initialize_kinto(loop, kinto_client, bucket, collection):
"""
Initialize the remote server with the initialization.yml file.
"""
# Leverage kinto-wizard async client.
thread_pool = ThreadPoolExecutor()
async_client = AsyncKintoClient(kinto_client, loop, thread_pool)
initialization_manifest = pkgutil.get_data('buildhub', 'initialization.yml')
config = yaml.safe_load(initialization_manifest)
# Check that we push the records at the right place.
if bucket not in config:
raise ValueError(f"Bucket '{bucket}' not specified in `initialization.yml`.")
if collection not in config[bucket]['collections']:
raise ValueError(f"Collection '{collection}' not specified in `initialization.yml`.")
await initialize_server(async_client,
config,
bucket=bucket,
collection=collection,
force=False)
评论列表
文章目录