mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
create: Drop hardcoded STABLE_OS_SUPPORT list
It's out of date, and doesn't even seem to work with current RHEL versions and no one is complaining. If we want to add it back, it should be an explicit setup.py configure option.
This commit is contained in:
parent
595b5b4bdf
commit
ce73272c7e
@ -60,11 +60,6 @@ INSTALL_PAGE_IMPORT = 3
|
||||
INSTALL_PAGE_CONTAINER_APP = 4
|
||||
INSTALL_PAGE_CONTAINER_OS = 5
|
||||
|
||||
STABLE_OS_SUPPORT = [
|
||||
"rhel3", "rhel4", "rhel5.4", "rhel6",
|
||||
"win2k3", "winxp", "win2k8", "vista", "win7",
|
||||
]
|
||||
|
||||
|
||||
def pretty_arch(_a):
|
||||
if _a == "armv7l":
|
||||
@ -809,25 +804,15 @@ class vmmCreate(vmmGObjectUI):
|
||||
widget = self.widget("install-os-type")
|
||||
model = widget.get_model()
|
||||
model.clear()
|
||||
filtervars = (self._stable_defaults() and
|
||||
STABLE_OS_SUPPORT or
|
||||
None)
|
||||
|
||||
# Kind of a hack, just show linux + windows by default since
|
||||
# that's all 98% of people care about
|
||||
supportl = ["generic", "linux", "windows"]
|
||||
|
||||
# Move 'generic' to the front of the list
|
||||
types = virtinst.OSDB.list_types()
|
||||
if not filtervars:
|
||||
# Kind of a hack, just show linux + windows by default since
|
||||
# that's all 98% of people care about
|
||||
supportl = ["linux", "windows"]
|
||||
else:
|
||||
supportl = []
|
||||
for typename in types:
|
||||
l = virtinst.OSDB.list_os(typename=typename,
|
||||
only_supported=True,
|
||||
filtervars=filtervars)
|
||||
if l:
|
||||
supportl.append(typename)
|
||||
|
||||
self._add_os_row(model, None, _("Generic"), True)
|
||||
types.remove("generic")
|
||||
types.insert(0, "generic")
|
||||
|
||||
for typename in types:
|
||||
supported = (typename in supportl)
|
||||
@ -837,41 +822,32 @@ class vmmCreate(vmmGObjectUI):
|
||||
|
||||
self._add_os_row(model, typename, typelabel, supported)
|
||||
|
||||
# Add sep
|
||||
self._add_os_row(model, sep=True)
|
||||
# Add action option
|
||||
self._add_os_row(model, label=_("Show all OS options"), action=True)
|
||||
|
||||
# Select 'generic' by default
|
||||
widget.set_active(0)
|
||||
|
||||
|
||||
def populate_os_variant_model(self, _type):
|
||||
model = self.widget("install-os-version").get_model()
|
||||
widget = self.widget("install-os-version")
|
||||
model = widget.get_model()
|
||||
model.clear()
|
||||
if not _type:
|
||||
self._add_os_row(model, None, _("Generic"), True)
|
||||
return
|
||||
|
||||
filtervars = (self._stable_defaults() and
|
||||
STABLE_OS_SUPPORT or
|
||||
None)
|
||||
preferred = self.config.preferred_distros
|
||||
|
||||
variants = virtinst.OSDB.list_os(typename=_type,
|
||||
sortpref=preferred)
|
||||
supportl = virtinst.OSDB.list_os(typename=_type,
|
||||
sortpref=preferred,
|
||||
only_supported=True,
|
||||
filtervars=filtervars)
|
||||
variants = virtinst.OSDB.list_os(typename=_type, sortpref=preferred)
|
||||
supportl = virtinst.OSDB.list_os(typename=_type, sortpref=preferred,
|
||||
only_supported=True)
|
||||
|
||||
for v in variants:
|
||||
supported = v in supportl
|
||||
supported = v in supportl or v.name == "generic"
|
||||
self._add_os_row(model, v.name, v.label, supported)
|
||||
|
||||
# Add sep
|
||||
self._add_os_row(model, sep=True)
|
||||
# Add action option
|
||||
self._add_os_row(model, label=_("Show all OS options"), action=True)
|
||||
|
||||
widget.set_active(0)
|
||||
|
||||
def populate_media_model(self, model, urls):
|
||||
model.clear()
|
||||
if urls is not None:
|
||||
@ -1211,10 +1187,6 @@ class vmmCreate(vmmGObjectUI):
|
||||
self.populate_os_type_model()
|
||||
return
|
||||
|
||||
self.widget("install-os-version-entry").set_text("")
|
||||
if self.widget("install-os-version").get_visible():
|
||||
self.widget("install-os-version-entry").grab_focus()
|
||||
|
||||
def change_os_version(self, box):
|
||||
show_all = uiutil.get_list_selection(box, 3)
|
||||
if not show_all:
|
||||
|
@ -234,24 +234,18 @@ class _OSDB(object):
|
||||
"solaris", "other", "generic"]
|
||||
return approved_types
|
||||
|
||||
def list_os(self, typename=None, filtervars=None,
|
||||
only_supported=False, **kwargs):
|
||||
def list_os(self, typename=None, only_supported=False, sortpref=None):
|
||||
sortmap = {}
|
||||
filtervars = filtervars or []
|
||||
|
||||
for key, osinfo in self._all_variants.items():
|
||||
if typename and typename != osinfo.get_typename():
|
||||
continue
|
||||
if filtervars:
|
||||
filtervars = [self.lookup_os(x).name for x in filtervars]
|
||||
if osinfo.name not in filtervars:
|
||||
continue
|
||||
if only_supported and not osinfo.supported:
|
||||
continue
|
||||
sortmap[key] = osinfo
|
||||
|
||||
kwargs["limit_point_releases"] = only_supported
|
||||
return _sort(sortmap, **kwargs)
|
||||
return _sort(sortmap, sortpref=sortpref,
|
||||
limit_point_releases=only_supported)
|
||||
|
||||
|
||||
#####################
|
||||
|
Loading…
Reference in New Issue
Block a user