summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2013-10-14 23:16:37 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2014-01-27 13:17:44 +0100
commitbda9aea3dc00b9ff953826d2563043dc1915b0aa (patch)
treeb0b09d8aabee4e1356d1dfb998934f45d5c6c6c7
parent4b72c5f2a0f016d1ad4dcd191f19dcd52cc98224 (diff)
downloadvirt-manager-bda9aea3dc00b9ff953826d2563043dc1915b0aa.tar.gz
virtinstall: allow to redefine typename in _OSVariant
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--virtinst/osdict.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index ed437688..d0d2c4dc 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -125,6 +125,7 @@ class _OSVariant(object):
@parent: Name of a pre-created variant that we want to extend. So
fedoraFOO would have parent fedoraFOO-1. It's used for inheiriting
values.
+ @typename: The family of the OS, e.g. "linux", "windows", "unix".
@sortby: A different key to use for sorting the distro list. By default
it's 'name', so this doesn't need to be specified.
@urldistro: This is a distro class. It's wired up in urlfetcher to give
@@ -149,7 +150,7 @@ class _OSVariant(object):
their usage.
"""
def __init__(self, name, label, is_type=False,
- sortby=None, parent=_SENTINEL,
+ sortby=None, parent=_SENTINEL, typename=_SENTINEL,
urldistro=_SENTINEL, supported=_SENTINEL,
three_stage_install=_SENTINEL,
acpi=_SENTINEL, apic=_SENTINEL, clock=_SENTINEL,
@@ -184,7 +185,10 @@ class _OSVariant(object):
self.sortby = sortby
self.is_type = bool(is_type)
- self.typename = _get_default("typename",
+
+ self.typename = typename
+ if typename == _SENTINEL:
+ self.typename = _get_default("typename",
self.is_type and self.name or _SENTINEL)
# 'types' should rarely be altered, this check will make