#NEWLINE# def delete_network( self , context , fixed_range , uuid , require_disassociated = True ) : #NEWLINE# #INDENT# elevated = context . elevated ( ) #NEWLINE# if uuid : #NEWLINE# #INDENT# network = objects . Network . get_by_uuid ( elevated , uuid ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if fixed_range : #NEWLINE# #INDENT# network = objects . Network . get_by_cidr ( elevated , fixed_range ) #NEWLINE# #UNINDENT# #UNINDENT# LOG . debug ( 'Delete network %s' , network [ 'uuid' ] ) #NEWLINE# if ( require_disassociated and ( network . project_id is not None ) ) : #NEWLINE# #INDENT# raise exception . NetworkHasProject ( project_id = network . project_id ) #NEWLINE# #UNINDENT# network . destroy ( )