def _sanitize_osdict_name(detectdistro): if detectdistro in ["none", "None", None]: return None if detectdistro == "testsuite-fedora-rawhide": # Special value we use in the test suite to always return the latest # fedora when checking rawhide URL return OSDB.latest_fedora_version() return detectdistro
def _sanitize_osdict_name(detectdistro): """ Try to handle working with out of date osinfo-db data. Like if checking distro FedoraXX but osinfo-db latest Fedora is FedoraXX-1, convert to use that """ if not detectdistro: return detectdistro if detectdistro == "testsuite-fedora-rawhide": # Special value we use in the test suite to always return the latest # fedora when checking rawhide URL return OSDB.latest_fedora_version() if re.match("fedora[0-9]+", detectdistro): if not OSDB.lookup_os(detectdistro): ret = OSDB.latest_fedora_version() print("\nConverting detectdistro=%s to latest value=%s" % (detectdistro, ret)) return ret return detectdistro