#NEWLINE# @ fake_tasks ( ) #NEWLINE# def test_deployment_fails_if_node_to_redeploy_is_offline( self ) : #NEWLINE# #INDENT# cluster = self . env . create_cluster ( api = True , status = consts . CLUSTER_STATUSES . operational ) #NEWLINE# offline_node = self . env . create_node ( cluster_id = cluster [ 'id' ] , roles = [ 'controller' ] , online = False , name = 'Offline node to be redeployed' , status = consts . NODE_STATUSES . ready ) #NEWLINE# self . env . create_node ( cluster_id = cluster [ 'id' ] , roles = [ 'controller' ] , pending_addition = True ) #NEWLINE# self . env . create_node ( cluster_id = cluster [ 'id' ] , roles = [ 'compute' ] , pending_addition = True ) #NEWLINE# supertask = self . env . launch_deployment ( ) #NEWLINE# self . assertEqual ( offline_node . status , consts . TASK_STATUSES . error ) #NEWLINE# msg = 'Nodes "{0}" are offline. Remove them from environment and try again.' . format ( offline_node . full_name ) #NEWLINE# self . assertEqual ( supertask . message , msg ) #NEWLINE# self . assertEqual ( cluster . status , 'error' )