summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-11-26 18:23:14 +0000
committerCole Robinson <crobinso@redhat.com>2022-01-17 14:51:36 -0500
commit35ef83d6285ce4851d2dc853a1337ee6ef17db84 (patch)
treea84a5b1f2331221b8c95d8e9d8e92f0afda99399
parent499badbdf4b0b3914a6078f7f37234dd6613ab1e (diff)
downloadvirt-manager-35ef83d6285ce4851d2dc853a1337ee6ef17db84.tar.gz
virtinst/osdict: remove osinfo legacy aliases
The code comment suggests removing the aliases after a year. It has now been three years, so it is time for them to go. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r--tests/test_cli.py2
-rw-r--r--tests/test_osdict.py9
-rw-r--r--virtinst/osdict.py59
3 files changed, 1 insertions, 69 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py
index ecd99032..a66a84d7 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -961,7 +961,7 @@ c.add_valid("--connect test:///default --test-stub-command", use_default_args=Fa
c.add_valid("--nodisks --pxe", grep="VM performance may suffer") # os variant warning
c.add_invalid("--hvm --nodisks --pxe foobar") # Positional arguments error
c.add_invalid("--nodisks --pxe --name test") # Colliding name
-c.add_compare("--os-type linux --cdrom %(EXISTIMG1)s --disk size=1 --disk %(EXISTIMG2)s,device=cdrom", "cdrom-double") # ensure --disk device=cdrom is ordered after --cdrom, this is important for virtio-win installs with a driver ISO
+c.add_compare("--cdrom %(EXISTIMG1)s --disk size=1 --disk %(EXISTIMG2)s,device=cdrom", "cdrom-double") # ensure --disk device=cdrom is ordered after --cdrom, this is important for virtio-win installs with a driver ISO
c.add_valid("--connect %s --pxe --disk size=1" % utils.URIs.test_defaultpool_collision) # testdriver already has a pool using the 'default' path, make sure we don't error
c.add_compare("--connect %(URI-KVM)s --reinstall test-clone-simple --pxe", "reinstall-pxe") # compare --reinstall with --pxe
c.add_compare("--connect %(URI-KVM)s --reinstall test-clone-simple --location http://example.com", "reinstall-location") # compare --reinstall with --location
diff --git a/tests/test_osdict.py b/tests/test_osdict.py
index aae913e7..a0e59e6b 100644
--- a/tests/test_osdict.py
+++ b/tests/test_osdict.py
@@ -18,15 +18,6 @@ from tests import utils
##################
-def test_osdict_aliases_ro():
- aliases = getattr(OSDB, "_aliases")
-
- if len(aliases) != 42:
- raise AssertionError(_("OSDB._aliases changed size. It "
- "should never be extended, since it is only for back "
- "compat with pre-libosinfo osdict.py"))
-
-
def test_list_os():
OSDB.list_os()
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index e68af80c..bd0c4d0f 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -129,56 +129,6 @@ class _OSDB(object):
self.__os_loader = None
self.__all_variants = None
- # This is only for back compatibility with pre-libosinfo support.
- # This should never change.
- _aliases = {
- "altlinux": "altlinux1.0",
- "debianetch": "debian4",
- "debianlenny": "debian5",
- "debiansqueeze": "debian6",
- "debianwheezy": "debian7",
- "freebsd10": "freebsd10.0",
- "freebsd6": "freebsd6.0",
- "freebsd7": "freebsd7.0",
- "freebsd8": "freebsd8.0",
- "freebsd9": "freebsd9.0",
- "mandriva2009": "mandriva2009.0",
- "mandriva2010": "mandriva2010.0",
- "mbs1": "mbs1.0",
- "msdos": "msdos6.22",
- "openbsd4": "openbsd4.2",
- "opensolaris": "opensolaris2009.06",
- "opensuse11": "opensuse11.4",
- "opensuse12": "opensuse12.3",
- "rhel4": "rhel4.0",
- "rhel5": "rhel5.0",
- "rhel6": "rhel6.0",
- "rhel7": "rhel7.0",
- "ubuntuhardy": "ubuntu8.04",
- "ubuntuintrepid": "ubuntu8.10",
- "ubuntujaunty": "ubuntu9.04",
- "ubuntukarmic": "ubuntu9.10",
- "ubuntulucid": "ubuntu10.04",
- "ubuntumaverick": "ubuntu10.10",
- "ubuntunatty": "ubuntu11.04",
- "ubuntuoneiric": "ubuntu11.10",
- "ubuntuprecise": "ubuntu12.04",
- "ubuntuquantal": "ubuntu12.10",
- "ubunturaring": "ubuntu13.04",
- "ubuntusaucy": "ubuntu13.10",
- "virtio26": "fedora10",
- "vista": "winvista",
- "winxp64": "winxp",
-
- # Old --os-type values
- "linux": "generic",
- "windows": "winxp",
- "solaris": "solaris10",
- "unix": "freebsd9.0",
- "other": "generic",
- }
-
-
#################
# Internal APIs #
#################
@@ -229,15 +179,6 @@ class _OSDB(object):
raise ValueError(_("Unknown libosinfo ID '%s'") % full_id)
def lookup_os(self, key, raise_error=False):
- if key not in self._all_variants and key in self._aliases:
- alias = self._aliases[key]
- # Added 2018-10-02. Maybe remove aliases in a year
- msg = (_("OS name '%(oldname)s' is deprecated, using '%(newname)s' "
- "instead. This alias will be removed in the future.") %
- {"oldname": key, "newname": alias})
- log.warning(msg)
- key = alias
-
ret = self._all_variants.get(key)
if ret is None and raise_error:
raise ValueError(_("Unknown OS name '%s'. "