#NEWLINE# def get_smartstack_replication_for_attribute( attribute , service , namespace , blacklist , system_paasta_config ) : #NEWLINE# #INDENT# "Loads smartstack replication from a host with the specified attribute\n\n    :param attribute: a Mesos attribute\n    :param service: A service name, like 'example_service'\n    :param namespace: A particular smartstack namespace to inspect, like 'main'\n    :param constraints: A list of Marathon constraints to restrict which synapse hosts to query\n    :param blacklist: A list of blacklisted location tuples in the form of (location, value)\n    :param system_paasta_config: A SystemPaastaConfig object representing the system configuration.\n    :returns: a dictionary of the form {'<unique_attribute_value>': <smartstack replication hash>}\n              (the dictionary will contain keys for unique all attribute values)\n    " #NEWLINE# replication_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# unique_values = mesos_tools . get_mesos_slaves_grouped_by_attribute ( attribute = attribute , blacklist = blacklist ) #NEWLINE# full_name = compose_job_id ( hosts , namespace ) #NEWLINE# for ( value , hosts ) in unique_values . iteritems ( ) : #NEWLINE# #INDENT# synapse_host = hosts [ 0 ] #NEWLINE# repl_info = replication_utils . get_replication_for_services ( synapse_host = synapse_host , synapse_port = system_paasta_config . get_synapse_port ( ) , synapse_haproxy_url_format = system_paasta_config . get_synapse_haproxy_url_format ( ) , services = [ full_name ] ) #NEWLINE# replication_info [ value ] = repl_info #NEWLINE# #UNINDENT# return replication_info