labpack/platforms/aws/r53.py
def list_zones(self):

        '''
            a method to retrieve the list of hosted zones on AWS Route 53

        :return: list of strings with hosted zone ids
        '''

        title = '%s.list_zones' % self.__class__.__name__

        # request list of hosted zones
        self.iam.printer('Querying AWS region %s for hosted zones.' % self.iam.region_name)
        zone_list = []
        try:
            response = self.connection.list_hosted_zones()
        except:
            raise AWSConnectionError(title)

        # populate list from response
        if 'HostedZones' in response:
            response_list = response['HostedZones']
            for zone in response_list:
                zone_id = zone['Id'].replace('/hostedzone/', '')
                zone_list.append(zone_id)

        # report results and return details
        if zone_list:
            print_out = 'Found zone'
            if len(zone_list) > 1:
                print_out += 's'
            from labpack.parsing.grammar import join_words
            print_out += ' %s.' % join_words(zone_list)
            self.iam.printer(print_out)
        else:
            self.iam.printer('No zones found.')

        return zone_list

            a method to retrieve the list of hosted zones on AWS Route 53

        :return: list of strings with hosted zone ids
        
a method to retrieve the list of hosted zones on AWS Route 53
a method to retrieve the list of hosted zones on AWS Route 53
def list_zones(self):
        title = '%s.list_zones' % self.__class__.__name__
        self.iam.printer('Querying AWS region %s for hosted zones.' % self.iam.region_name)
        zone_list = []
        try:
            response = self.connection.list_hosted_zones()
        except:
            raise AWSConnectionError(title)
        if 'HostedZones' in response:
            response_list = response['HostedZones']
            for zone in response_list:
                zone_id = zone['Id'].replace('/hostedzone/', '')
                zone_list.append(zone_id)
        if zone_list:
            print_out = 'Found zone'
            if len(zone_list) > 1:
                print_out += 's'
            from labpack.parsing.grammar import join_words
            print_out += ' %s.' % join_words(zone_list)
            self.iam.printer(print_out)
        else:
            self.iam.printer('No zones found.')
        return zone_list
def list_zones ( self ) : title = '%s.list_zones' % self . __class__ . __name__ self . iam . printer ( 'Querying AWS region %s for hosted zones.' % self . iam . region_name ) zone_list = [ ] try : response = self . connection . list_hosted_zones ( ) except : raise AWSConnectionError ( title ) if 'HostedZones' in response : response_list = response [ 'HostedZones' ] for zone in response_list : zone_id = zone [ 'Id' ] . replace ( '/hostedzone/' , '' ) zone_list . append ( zone_id ) if zone_list : print_out = 'Found zone' if len ( zone_list ) > 1 : print_out += 's' from labpack . parsing . grammar import join_words print_out += ' %s.' % join_words ( zone_list ) self . iam . printer ( print_out ) else : self . iam . printer ( 'No zones found.' ) return zone_list
a method to retrieve the list of hosted zones on AWS Route 53
a method to retrieve the list of hosted zones on AWS Route 53
'''
            a method to retrieve the list of hosted zones on AWS Route 53

        :return: list of strings with hosted zone ids
        ''' # request list of hosted zones # populate list from response # report results and return details
list of strings with hosted zone ids
list of strings with hosted zone ids
self