#NEWLINE# @ classmethod #NEWLINE# def message( cls , task , nodes , affected_nodes = None , deployment_tasks = None , reexecutable_filter = None , graph_type = None , force = False ) : #NEWLINE# #INDENT# 'Builds RPC message for deployment task.\n\n        :param task: the database task object instance\n        :param nodes: the nodes for deployment\n        :param affected_nodes: the list of nodes is affected by deployment\n        :param deployment_tasks: the list of tasks_ids to execute,\n                                 if None, all tasks will be executed\n        :param reexecutable_filter: the list of events to find subscribed tasks\n        :param graph_type: deployment graph type\n        ' #NEWLINE# logger . debug ( ( 'DeploymentTask.message(task=%s)' % task . uuid ) ) #NEWLINE# task_ids = ( deployment_tasks or [ ] ) #NEWLINE# objects . NodeCollection . lock_nodes ( nodes ) #NEWLINE# for n in nodes : #NEWLINE# #INDENT# if n . pending_roles : #NEWLINE# #INDENT# n . roles = ( n . roles + n . pending_roles ) #NEWLINE# n . pending_roles = [ ] #NEWLINE# if ( n . status in ( consts . NODE_STATUSES . deploying , ) ) : #NEWLINE# #INDENT# n . status = consts . NODE_STATUSES . provisioned #NEWLINE# #UNINDENT# n . progress = 0 #NEWLINE# #UNINDENT# #UNINDENT# db ( ) . flush ( ) #NEWLINE# deployment_tasks = objects . Cluster . get_deployment_tasks ( task . cluster , graph_type ) #NEWLINE# ( deployment_mode , message ) = cls . call_deployment_method ( task , tasks = deployment_tasks , nodes = nodes , affected_nodes = affected_nodes , selected_task_ids = task_ids , events = reexecutable_filter , force = force ) #NEWLINE# for node in nodes : #NEWLINE# #INDENT# node . pending_addition = False #NEWLINE# #UNINDENT# objects . Transaction . attach_cluster_settings ( task , { #NEWLINE# #INDENT# 'editable' : objects . Cluster . get_editable_attributes ( task . cluster , all_plugins_versions = True ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# objects . Transaction . attach_network_settings ( task , objects . Cluster . get_network_attributes ( task . cluster ) ) #NEWLINE# rpc_message = make_astute_message ( task , deployment_mode , 'deploy_resp' , message ) #NEWLINE# db ( ) . flush ( ) #NEWLINE# return rpc_message