#NEWLINE# def get_config_group( instance ) : #NEWLINE# #INDENT# params = get_instance_params_mapping ( instance ) #NEWLINE# groups = [ ] #NEWLINE# for ( service , targets ) in six . iteritems ( get_service_to_configs_map ( ) ) : #NEWLINE# #INDENT# current_group = { #NEWLINE# #INDENT# 'cluster_name' : instance . cluster . name , #NEWLINE# 'group_name' : ( '%s:%s' % ( instance . cluster . name , instance . instance_name ) ) , #NEWLINE# 'tag' : service , #NEWLINE# 'description' : ( 'Config group for scaled node %s' % instance . instance_name ) , #NEWLINE# 'hosts' : [ { #NEWLINE# #INDENT# 'host_name' : instance . fqdn ( ) , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'desired_configs' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# at_least_one_added = False #NEWLINE# for target in targets : #NEWLINE# #INDENT# configs = params . get ( target , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if configs : #NEWLINE# #INDENT# current_group [ 'desired_configs' ] . append ( { #NEWLINE# #INDENT# 'type' : target , #NEWLINE# 'properties' : configs , #NEWLINE# 'tag' : current_group . instance_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# at_least_one_added = True #NEWLINE# #UNINDENT# #UNINDENT# if at_least_one_added : #NEWLINE# #INDENT# groups . append ( { #NEWLINE# #INDENT# 'ConfigGroup' : current_group , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return groups