#NEWLINE# def _is_decommissioned( r , inst_to_be_deleted ) : #NEWLINE# #INDENT# cmd = r . execute_command ( 'sudo -u hdfs hadoop dfsadmin -report' ) #NEWLINE# datanodes_info = parse_dfs_report ( cmd [ 1 ] ) #NEWLINE# for i in r : #NEWLINE# #INDENT# for dn in datanodes_info : #NEWLINE# #INDENT# if ( dn [ 'Name' ] . startswith ( i . internal_ip ) and ( dn [ 'Decommission Status' ] != 'Decommissioned' ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return True