def get_cdn_urls(self, hsh, request_type, request_format_tag=''):
        """
        Returns a dict of the outgoing urls for a HEAD or GET req.

        :param request_format_tag: the tag matching the section in
                                   the conf file that will be used to
                                   format the request
        """
        format_section = None
        section_names = ['outgoing_url_format_%s_%s' % (request_type.lower(),
                                                        request_format_tag),
                         request_type.lower() % 'outgoing_url_format_%s',
                         'outgoing_url_format']
        for section_name in section_names:
            format_section = self.conf.get(section_name)
            if format_section:
                break
        else:
            raise InvalidConfiguration('Could not find format for: %s, %s'
                                       % (request_type, request_format_tag))

        url_vars = {'hash': hsh,
                    'hash_mod': int(hsh, 16) % self.number_dns_shards}
        cdn_urls = {}
        for key, url in format_section.items():
            cdn_urls[key] = (url % url_vars).rstrip('/')
        if self.hmac_signed_url_secret:
            for key, url in cdn_urls.iteritems():
                parsed = urlparse(url)
                token = hmac.new(key=self.hmac_signed_url_secret,
                                 msg=parsed.hostname,
                                 digestmod=sha1).hexdigest()
                cdn_urls[key] = '%s://%s-%s' % (parsed.scheme,
                                                token[:self.token_length],
                                                parsed.hostname)
        return cdn_urls
dataset/ETHPy150Open dpgoetz/sos/sos/origin.py/OriginBase.get_cdn_urls/swapped operands of `%`