#NEWLINE# @ cpo . event_wrapper ( True , step = _ ( 'Delete instances' ) , param = ( 'cluster' , 1 ) ) #NEWLINE# def delete_instances( self , cluster , instances ) : #NEWLINE# #INDENT# api = self . get_api_client ( cluster ) #NEWLINE# cm_cluster = self . get_cloudera_cluster ( cluster ) #NEWLINE# hosts = api . get_all_hosts ( view = 'full' ) #NEWLINE# hostsnames_to_deleted = [ i . fqdn ( ) for i in instances ] #NEWLINE# for host in hosts : #NEWLINE# #INDENT# if ( host . hostname in hostsnames_to_deleted ) : #NEWLINE# #INDENT# cm_cluster . remove_host ( host . hostId ) #NEWLINE# api . delete_host ( host . hostId )