#NEWLINE# def _floating_ip_owned_by_project( self , context , floating_ip ) : #NEWLINE# #INDENT# 'Raises if floating IP does not belong to project.' #NEWLINE# if context . is_admin : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( floating_ip . project_id != context . project_id ) : #NEWLINE# #INDENT# if ( floating_ip . project_id is None ) : #NEWLINE# #INDENT# LOG . warning ( _LW ( 'Address |%(address)s| is not allocated' ) , { #NEWLINE# #INDENT# 'address' : floating_ip . address , #NEWLINE# #UNINDENT# } ) #NEWLINE# raise exception . Forbidden ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . warning ( _LW ( 'Address |%(address)s| is not allocated to your project |%(project)s|' ) , { #NEWLINE# #INDENT# 'address' : floating_ip . address , #NEWLINE# 'project' : context . project_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# raise exception . Forbidden ( )