#NEWLINE# @ classmethod #NEWLINE# def _check_nodes_are_online( cls , task ) : #NEWLINE# #INDENT# offline_nodes = db ( ) . query ( Node ) . filter ( ( Node . cluster == task . cluster ) ) . filter_by ( online = False ) . filter_by ( pending_deletion = False ) #NEWLINE# offline_nodes_not_ready = [ n for n in offline_nodes if ( n . status != consts . NODE_STATUSES . ready ) ] #NEWLINE# nodes_to_deploy = TaskHelper . nodes_to_deploy ( task . cluster ) #NEWLINE# offline_nodes_to_redeploy = [ n for n in offline_nodes if ( ( n . status == consts . NODE_STATUSES . ready ) and ( n in nodes_to_deploy ) ) ] #NEWLINE# if ( offline_nodes_not_ready or offline_nodes_to_redeploy ) : #NEWLINE# #INDENT# node_names = ',' . join ( map ( ( lambda n : n . full_name ) , ( offline_nodes_not_ready + nodes_to_deploy ) ) ) #NEWLINE# raise errors . NodeOffline ( 'Nodes "{0}" are offline. Remove them from environment and try again.' . format ( node_names ) )