#NEWLINE# def lease_fixed_ip( self , context , address ) : #NEWLINE# #INDENT# 'Called by dhcp-bridge when ip is leased.' #NEWLINE# LOG . debug ( _ ( 'Leased IP |%(address)s|' ) , locals ( ) , context = context ) #NEWLINE# fixed_ip = self . db . fixed_ip_get_by_address ( context , address ) #NEWLINE# instance = fixed_ip [ 'instance' ] #NEWLINE# if ( not instance ) : #NEWLINE# #INDENT# raise exception . Error ( ( _ ( 'IP %s leased that is not associated' ) % address ) ) #NEWLINE# #UNINDENT# now = utils . utcnow ( ) #NEWLINE# self . db . fixed_ip_update ( context , fixed_ip [ 'address' ] , { #NEWLINE# #INDENT# 'leased' : True , #NEWLINE# 'updated_at' : now , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not now [ 'allocated' ] ) : #NEWLINE# #INDENT# LOG . warn ( _ ( "IP |%s| leased that isn't allocated" ) , address , context = context )