aws_info_helper/route53.py
def update_collection(self):
        """Update the rh.Collection object if redis-helper installed"""
        if self._collection is None:
            return

        updates = []
        self._collection.clear_keyspace()
        for data in self.get_all_record_sets_for_all_zones():
            value = data.get('value')
            data.update(dict(profile=self._profile))
            try:
                match = ah.IP_RX.match(value)
            except TypeError:
                if type(value) == list:
                    matches = [ah.IP_RX.match(v) for v in value]
                    assert len(matches) == len(value)
                    ips = value
                elif value is None:
                    ips = []
                else:
                    raise
            else:
                if match:
                    ips = [value]
                else:
                    ips = []

            if not ips:
                updates.append(self._collection.add(**data))
            else:
                for ip in ips:
                    data['value'] = ip
                    existing = ah.AWS_IP.find(
                        'ip:{}, name:{}'.format(ip, data['name']),
                        include_meta=False
                    )
                    if not existing:
                        updates.append(ah.AWS_IP.add(
                            ip=ip,
                            name=data['name'],
                            source='route53',
                            profile=self._profile
                        ))
                    updates.append(self._collection.add(**data))
        return {'updates': updates}
Update the rh.Collection object if redis-helper installed
Update the rh.Collection object if redis-helper installed
Update the rh . Collection object if redis - helper installed
def update_collection(self):
        if self._collection is None:
            return
        updates = []
        self._collection.clear_keyspace()
        for data in self.get_all_record_sets_for_all_zones():
            value = data.get('value')
            data.update(dict(profile=self._profile))
            try:
                match = ah.IP_RX.match(value)
            except TypeError:
                if type(value) == list:
                    matches = [ah.IP_RX.match(v) for v in value]
                    assert len(matches) == len(value)
                    ips = value
                elif value is None:
                    ips = []
                else:
                    raise
            else:
                if match:
                    ips = [value]
                else:
                    ips = []
            if not ips:
                updates.append(self._collection.add(**data))
            else:
                for ip in ips:
                    data['value'] = ip
                    existing = ah.AWS_IP.find(
                        'ip:{}, name:{}'.format(ip, data['name']),
                        include_meta=False
                    )
                    if not existing:
                        updates.append(ah.AWS_IP.add(
                            ip=ip,
                            name=data['name'],
                            source='route53',
                            profile=self._profile
                        ))
                    updates.append(self._collection.add(**data))
        return {'updates': updates}
def update_collection ( self ) : if self . _collection is None : return updates = [ ] self . _collection . clear_keyspace ( ) for data in self . get_all_record_sets_for_all_zones ( ) : value = data . get ( 'value' ) data . update ( dict ( profile = self . _profile ) ) try : match = ah . IP_RX . match ( value ) except TypeError : if type ( value ) == list : matches = [ ah . IP_RX . match ( v ) for v in value ] assert len ( matches ) == len ( value ) ips = value elif value is None : ips = [ ] else : raise else : if match : ips = [ value ] else : ips = [ ] if not ips : updates . append ( self . _collection . add ( ** data ) ) else : for ip in ips : data [ 'value' ] = ip existing = ah . AWS_IP . find ( 'ip:{}, name:{}' . format ( ip , data [ 'name' ] ) , include_meta = False ) if not existing : updates . append ( ah . AWS_IP . add ( ip = ip , name = data [ 'name' ] , source = 'route53' , profile = self . _profile ) ) updates . append ( self . _collection . add ( ** data ) ) return { 'updates' : updates }
Update the rh.Collection object if redis-helper installed
Update the rh . Collection object if redis - helper installed
"""Update the rh.Collection object if redis-helper installed"""
self