#NEWLINE# def handle( self , request , context ) : #NEWLINE# #INDENT# url = reverse ( 'horizon:project:network_services:index' ) #NEWLINE# try : #NEWLINE# #INDENT# if context . get ( 'name' ) : #NEWLINE# #INDENT# context [ 'name' ] = html . escape ( context [ 'name' ] ) #NEWLINE# #UNINDENT# if context . get ( 'description' ) : #NEWLINE# #INDENT# context [ 'description' ] = html . escape ( context [ 'description' ] ) #NEWLINE# #UNINDENT# client . create_servicechain_spec ( request , ** e ) #NEWLINE# msg = _ ( 'Service Chain Spec Created Successfully!' ) #NEWLINE# LOG . debug ( msg ) #NEWLINE# messages . success ( request , msg ) #NEWLINE# return http . HttpResponseRedirect ( url ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# msg = ( _ ( 'Failed to create Service Chain Spec.  %s' ) % str ( e ) ) #NEWLINE# LOG . error ( msg ) #NEWLINE# exceptions . handle ( request , msg , redirect = url )