#NEWLINE# def get_resources_for_import( self ) : #NEWLINE# #INDENT# cur_instances = models . Instance . objects . all ( ) . values_list ( 'backend_id' , flat = True ) #NEWLINE# try : #NEWLINE# #INDENT# instances = self . nova_client . servers . list ( ) #NEWLINE# #UNINDENT# except nova_exceptions . ClientException as e : #NEWLINE# #INDENT# six . reraise ( OpenStackBackendError , e ) #NEWLINE# #UNINDENT# return [ { #NEWLINE# #INDENT# 'id' : instance . id , #NEWLINE# 'name' : ( instance . name or instance . id ) , #NEWLINE# 'created_at' : instance . created , #NEWLINE# 'status' : instance . status , #NEWLINE# #UNINDENT# } for instance in instances if ( ( instance . id not in cur_instances ) and ( self . _get_instance_state ( instance ) != models . Instance . States . ERRED ) ) ]