#NEWLINE# def _getAmazonIPsCallback( self , data ) : #NEWLINE# #INDENT# if ( data [ 0 ] [ 0 ] == True ) : #NEWLINE# #INDENT# self . local_ip = data [ 0 ] [ 1 ] #NEWLINE# logger . debug ( ( 'Got local IP %s from Amazon.' % self . local_ip ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( 'Could not get local IP from Amazon.' ) #NEWLINE# #UNINDENT# if ( data [ 1 ] [ 0 ] == True ) : #NEWLINE# #INDENT# public_ip = data [ 1 ] [ 1 ] #NEWLINE# logger . debug ( ( 'Got public IP %s from Amazon.' % response ) ) #NEWLINE# response = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( self . local_ip is not None ) : #NEWLINE# #INDENT# response [ 'local_ip' ] = self . local_ip #NEWLINE# #UNINDENT# response [ 'public_ip' ] = public_ip #NEWLINE# return response #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( 'Could not get public IP from Amazon.' ) #NEWLINE# raise Exception ( 'Could not get public IP from Amazon.' )