def _find_template_and_rpm_name(self, instance, build_name):
        search_names = [(build_name, "%s.spec" % build_name)]

        try:
            egg_name = instance.egg_info['name']
        except __HOLE__:
            pass
        else:
            if any(s.endswith("client")
                   for s in (instance.name, egg_name, build_name)):
                search_names.append([egg_name, "python-commonclient.spec"])
            search_names.extend([
                ("openstack-%s" % (egg_name), "openstack-%s.spec" % (egg_name)),
                (egg_name, "%s.spec" % (egg_name)),
            ])

        # Return the first that exists (if any from this list)
        for (rpm_name, template_name) in search_names:
            spec_filename = sh.joinpths(settings.TEMPLATE_DIR,
                                        self.SPEC_TEMPLATE_DIR, template_name)
            if sh.isfile(spec_filename):
                return (rpm_name, template_name)
        return (None, None)
dataset/ETHPy150Open openstack/anvil/anvil/packaging/yum.py/YumDependencyHandler._find_template_and_rpm_name