#NEWLINE# def _disallow_ip( self , arn , ip ) : #NEWLINE# #INDENT# if ( 'Statement' not in self ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# need_update = False #NEWLINE# for statement in self [ 'Statement' ] : #NEWLINE# #INDENT# if ( statement [ 'Resource' ] == arn ) : #NEWLINE# #INDENT# for condition_name in statement [ 'Condition' ] : #NEWLINE# #INDENT# if ( condition_name == 'IpAddress' ) : #NEWLINE# #INDENT# condition = statement [ 'Condition' ] [ condition_name ] #NEWLINE# if ( ip in condition [ 'aws:SourceIp' ] ) : #NEWLINE# #INDENT# condition [ 'aws:SourceIp' ] . remove ( ip ) #NEWLINE# need_update = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if need_update : #NEWLINE# #INDENT# self . save ( )