#NEWLINE# def handle( self , request , data ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# api . neutron . router_add_gateway ( request , data [ 'router_id' ] , data [ 'network_id' ] ) #NEWLINE# msg = _ ( 'Gateway interface is added' ) #NEWLINE# LOG . debug ( msg ) #NEWLINE# messages . success ( request , msg ) #NEWLINE# return True #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# msg = ( _ ( 'Failed to set gateway %s' ) % e ) #NEWLINE# LOG . info ( msg ) #NEWLINE# redirect = reverse ( self . failure_url ) #NEWLINE# exceptions . handle ( request , data , redirect = redirect )