def _update_dataset_primary(deployment, dataset_id, primary):
 (primary_manifestation, old_primary_node) = _find_manifestation_and_node(deployment, dataset_id)
 old_primary_node = old_primary_node.transform(('manifestations', primary_manifestation.dataset_id), discard)
 deployment = deployment.update_node(old_primary_node)
 new_primary_node = deployment.get_node(primary)
 new_primary_node = new_primary_node.transform(('manifestations', dataset_id), primary_manifestation)
 deployment = deployment.update_node(new_primary_node)
 return deployment

def _update_dataset_primary ( deployment , dataset_id , primary ) : ( primary_manifestation , old_primary_node ) = _find_manifestation_and_node ( deployment , dataset_id ) old_primary_node = old_primary_node . transform ( ( 'manifestations' , primary_manifestation . dataset_id ) , discard ) deployment = deployment . update_node ( old_primary_node ) new_primary_node = deployment . get_node ( primary ) new_primary_node = new_primary_node . transform ( ( 'manifestations' , dataset_id ) , primary_manifestation ) deployment = deployment . update_node ( new_primary_node ) return deployment
update the deployment so that the dataset with the supplied dataset_id is on the node with the supplied primary address .