'Get repos that can be used with a given profile name'

def get_repos_compatible_with_profile(self, profile=None, token=None, **rest):

    self._log('get_repos_compatible_with_profile', token=token)
    profile = self.api.find_profile(profile)
    if (profile is None):
        return (-1)
    results = []
    distro = profile.get_conceptual_parent()
    repos = self.get_repos()
    for r in repos:
        if ((r['arch'] is None) or (r['arch'] in ['', 'noarch', 'src'])):
            results.append(r)
        elif (r['arch'] in ['i386', 'x86', 'i686']):
            if (distro.arch in ['i386', 'x86']):
                results.append(r)
        elif (r['arch'] in ['x86_64']):
            if (distro.arch in ['x86_64']):
                results.append(r)
        elif (distro.arch == r['arch']):
            results.append(r)
    return results
