#NEWLINE# def _get_servers( self , request ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( servers , more ) = api . nova . server_list ( request ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# servers = [ ] #NEWLINE# #UNINDENT# console_type = getattr ( settings , 'CONSOLE_TYPE' , 'AUTO' ) #NEWLINE# if ( console_type == 'SPICE' ) : #NEWLINE# #INDENT# console = 'spice' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console = 'vnc' #NEWLINE# #UNINDENT# data = [ { #NEWLINE# #INDENT# 'name' : server . name , #NEWLINE# 'status' : server . status , #NEWLINE# 'console' : request , #NEWLINE# 'task' : getattr ( server , 'OS-EXT-STS:task_state' ) , #NEWLINE# 'id' : server . id , #NEWLINE# #UNINDENT# } for server in servers ] #NEWLINE# self . add_resource_url ( 'horizon:project:instances:detail' , data ) #NEWLINE# return data