#NEWLINE# def _get_zone_id( self , domain ) : #NEWLINE# #INDENT# if ( domain [ ( - 1 ) ] != '.' ) : #NEWLINE# #INDENT# domain += '.' #NEWLINE# #UNINDENT# result = self . conn . get_all_hosted_zones ( ) #NEWLINE# hosted_zones = result [ 'ListHostedZonesResponse' ] [ 'HostedZones' ] #NEWLINE# while ( domain != '.' ) : #NEWLINE# #INDENT# for zone in hosted_zones : #NEWLINE# #INDENT# app . logger . debug ( '{} {}' . format ( zone [ 'Name' ] , domain ) ) #NEWLINE# if ( zone [ 'Name' ] == domain ) : #NEWLINE# #INDENT# return zone [ 'Id' ] . replace ( '/hostedzone/' , '' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# domain = domain [ ( domain . find ( '.' ) + 1 ) : ] #NEWLINE# #UNINDENT# #UNINDENT# raise ZoneIDNotFound ( self )