#NEWLINE# @ wrap_check_policy #NEWLINE# @ check_instance_cell #NEWLINE# def get_spice_console( self , context , instance , console_type ) : #NEWLINE# #INDENT# 'Get a url to a SPICE Console.' #NEWLINE# if ( not instance . host ) : #NEWLINE# #INDENT# raise exception . InstanceNotReady ( instance_id = instance . uuid ) #NEWLINE# #UNINDENT# connect_info = self . _call_to_cells ( self , instance , 'get_spice_connect_info' , console_type ) #NEWLINE# self . consoleauth_rpcapi . authorize_console ( context , connect_info [ 'token' ] , console_type , connect_info [ 'host' ] , connect_info [ 'port' ] , connect_info [ 'internal_access_path' ] , instance . uuid , access_url = connect_info [ 'access_url' ] ) #NEWLINE# return { #NEWLINE# #INDENT# 'url' : connect_info [ 'access_url' ] , #NEWLINE# #UNINDENT# }