コード例 #1
0
ファイル: couchdb.py プロジェクト: dirkdejager/commcare-cloud
def commit_migration(migration):
    plan_by_db = {
        shard_allocation.db_name: shard_allocation
        for shard_allocation in migration.shard_plan
    }
    shard_allocations = get_shard_allocation_from_plan(
        migration.source_couch_config, plan_by_db, create=True)
    for shard_allocation_doc in shard_allocations:
        response = put_shard_allocation(migration.target_couch_config,
                                        shard_allocation_doc)
        print(response)
コード例 #2
0
ファイル: couchdb.py プロジェクト: dimagi/commcarehq-ansible
def commit_migration(migration):
    plan_by_db = {
        shard_allocation.db_name: shard_allocation
        for shard_allocation in migration.shard_plan
    }
    shard_allocations = get_shard_allocation_from_plan(
        migration.source_couch_config, plan_by_db, create=True
    )
    for shard_allocation_doc in shard_allocations:
        response = put_shard_allocation(migration.target_couch_config, shard_allocation_doc)
        print(response)