#NEWLINE# def handle( self , request , context ) : #NEWLINE# #INDENT# url = reverse ( 'horizon:project:network_services:index' ) #NEWLINE# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# del context [ 'template_string' ] #NEWLINE# del context [ 'template_file' ] #NEWLINE# del context [ 'config_type' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# context [ 'config' ] = json . dumps ( context [ 'config' ] ) #NEWLINE# 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_node ( request , ** context ) #NEWLINE# msg = _ ( 'Service Chain Node Created Successfully!' ) #NEWLINE# LOG . debug ( msg ) #NEWLINE# return http . HttpResponseRedirect ( url ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# msg = ( _ ( 'Failed to create Service Chain Node. %s' ) % str ( e ) ) #NEWLINE# LOG . error ( msg ) #NEWLINE# exceptions . handle ( request , msg , redirect = shortcuts . redirect )