'Returns a list of image id and location tuple from scrub queue.
:returns: a list of image id, location id and uri tuple from
scrub queue'

def get_all_locations(self):

    ret = []
    for image in self._get_all_images():
        deleted_at = image.get('deleted_at')
        if (not deleted_at):
            continue
        date_str = deleted_at.rsplit('.', 1)[0].rsplit(',', 1)[0]
        delete_time = calendar.timegm(time.strptime(date_str, '%Y-%m-%dT%H:%M:%S'))
        if ((delete_time + self.scrub_time) > time.time()):
            continue
        for loc in image['location_data']:
            if (loc['status'] != 'pending_delete'):
                continue
            if self.metadata_encryption_key:
                uri = crypt.urlsafe_encrypt(self.metadata_encryption_key, loc['url'], 64)
            else:
                uri = loc['url']
            ret.append((image['id'], loc['id'], uri))
    return ret
