#NEWLINE# def _create_network( self , request , data ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# params = { #NEWLINE# #INDENT# 'name' : data [ 'net_name' ] , #NEWLINE# 'admin_state_up' : data [ 'admin_state' ] , #NEWLINE# #UNINDENT# } #NEWLINE# if api . neutron . is_port_profiles_supported ( ) : #NEWLINE# #INDENT# params [ 'net_profile_id' ] = data [ 'net_profile_id' ] #NEWLINE# #UNINDENT# network = api . neutron . network_create ( request , ** params ) #NEWLINE# network . set_id_as_name_if_empty ( ) #NEWLINE# self . context [ 'net_id' ] = network . id #NEWLINE# msg = ( _ ( 'Network "%s" was successfully created.' ) % network . name ) #NEWLINE# LOG . debug ( msg ) #NEWLINE# return network #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# msg = ( _ ( 'Failed to create network "%(network)s": %(reason)s' ) % { #NEWLINE# #INDENT# 'network' : data [ 'net_name' ] , #NEWLINE# 'reason' : network , #NEWLINE# #UNINDENT# } ) #NEWLINE# LOG . info ( msg ) #NEWLINE# redirect = self . get_failure_url ( ) #NEWLINE# exceptions . handle ( request , msg , redirect = redirect ) #NEWLINE# return False