#NEWLINE# @ classmethod #NEWLINE# def validate_delete( cls , data , instance ) : #NEWLINE# #INDENT# if instance . is_default : #NEWLINE# #INDENT# raise errors . CannotDelete ( 'Default node group cannot be deleted.' ) #NEWLINE# #UNINDENT# if ( instance . nodes and ( not all ( ( ( node . status == consts . NODE_STATUSES . discover ) for node in node . nodes ) ) ) ) : #NEWLINE# #INDENT# raise errors . CannotDelete ( 'Node group can be deleted only when all its nodes are in bootstrap state.' )