def get_trial_environment(cluster, package_source):
 return {'FLOCKER_ACCEPTANCE_CONTROL_NODE': cluster.control_node.address, 'FLOCKER_ACCEPTANCE_NUM_AGENT_NODES': str(len(cluster.agent_nodes)), 'FLOCKER_ACCEPTANCE_VOLUME_BACKEND': cluster.dataset_backend.name, 'FLOCKER_ACCEPTANCE_API_CERTIFICATES_PATH': cluster.certificates_path.path, 'FLOCKER_ACCEPTANCE_HOSTNAME_TO_PUBLIC_ADDRESS': json.dumps({node.private_address: node.address for node in cluster.agent_nodes if (node.private_address is not None)}), 'FLOCKER_ACCEPTANCE_DEFAULT_VOLUME_SIZE': bytes(cluster.default_volume_size), 'FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG': cluster.dataset_backend_config_file.path, 'FLOCKER_ACCEPTANCE_DISTRIBUTION': cluster.control_node.distribution, 'FLOCKER_ACCEPTANCE_PACKAGE_BRANCH': (package_source.branch or ''), 'FLOCKER_ACCEPTANCE_PACKAGE_VERSION': (package_source.version or ''), 'FLOCKER_ACCEPTANCE_PACKAGE_BUILD_SERVER': package_source.build_server}

def get_trial_environment ( cluster , package_source ) : return { 'FLOCKER_ACCEPTANCE_CONTROL_NODE' : cluster . control_node . address , 'FLOCKER_ACCEPTANCE_NUM_AGENT_NODES' : str ( len ( cluster . agent_nodes ) ) , 'FLOCKER_ACCEPTANCE_VOLUME_BACKEND' : cluster . dataset_backend . name , 'FLOCKER_ACCEPTANCE_API_CERTIFICATES_PATH' : cluster . certificates_path . path , 'FLOCKER_ACCEPTANCE_HOSTNAME_TO_PUBLIC_ADDRESS' : json . dumps ( { node . private_address : node . address for node in cluster . agent_nodes if ( node . private_address is not None ) } ) , 'FLOCKER_ACCEPTANCE_DEFAULT_VOLUME_SIZE' : bytes ( cluster . default_volume_size ) , 'FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG' : cluster . dataset_backend_config_file . path , 'FLOCKER_ACCEPTANCE_DISTRIBUTION' : cluster . control_node . distribution , 'FLOCKER_ACCEPTANCE_PACKAGE_BRANCH' : ( package_source . branch or '' ) , 'FLOCKER_ACCEPTANCE_PACKAGE_VERSION' : ( package_source . version or '' ) , 'FLOCKER_ACCEPTANCE_PACKAGE_BUILD_SERVER' : package_source . build_server }
return a dictionary of environment variables describing a cluster for acceptance testing .