From bfb3174ec293d57575bcbc681fad9cb554264f7c Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 7 Sep 2014 10:49:50 -0400 Subject: [PATCH] osdict: Manually tweak 'supported' info Many old OSes don't have an EOL date tracked with libosinfo, and we just treat them as 'supported'. So the default distro list in the create wizard is wayyy too huge and contains all sorts of crazy options. Assume lack of EOL date means 'unsupported', and add a manual whitelist for some still common distros. We will fix this at the libosinfo level. --- virtinst/osdict.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/virtinst/osdict.py b/virtinst/osdict.py index 846df1c38..4277578b9 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -434,9 +434,20 @@ class _OsVariantOsInfo(_OSVariant): def _get_supported(self): d = self._os.get_eol_date_string() - if self._os.get_distro() == "msdos": - return False - return d is None or datetime.strptime(d, "%Y-%m-%d") > datetime.now() + name = self._os.get_short_id() + + if d: + return datetime.strptime(d, "%Y-%m-%d") > datetime.now() + + # As of libosinfo 2.11, many clearly EOL distros don't have an + # EOL date. So assume None == EOL, add some manual work arounds. + # We should fix this in a new libosinfo version, and then drop + # this hack + if name in ["rhel7.0", "rhel7.1", "fedora19", "fedora20", "fedora21", + "debian6", "debian7", "ubuntu13.04", "ubuntu13.10", "ubuntu14.04", + "ubuntu14.10", "win8", "win8.1", "win2k12", "win2k12r2"]: + return True + return False def _get_urldistro(self): urldistro = self._os.get_distro()