osdict: add "macos" type

Give macOS OSes an own type, so they have their own entry in the list of
OS types.
This commit is contained in:
Pino Toscano
2017-04-24 16:20:43 +02:00
committed by Cole Robinson
parent fa9ee6cd94
commit 7866cfec1b
2 changed files with 5 additions and 1 deletions

View File

@@ -978,6 +978,7 @@ class vmmCreate(vmmGObjectUI):
"bsd": _("BSD"),
"generic": _("Generic"),
"linux": _("Linux"),
"macos": _("macOS"),
"other": _("Others"),
"solaris": _("Solaris"),
"windows": _("Windows"),

View File

@@ -244,7 +244,7 @@ class _OSDB(object):
return osname
def list_types(self):
approved_types = ["linux", "windows", "bsd",
approved_types = ["linux", "windows", "bsd", "macos",
"solaris", "other", "generic"]
return approved_types
@@ -423,6 +423,9 @@ class _OsVariant(object):
if self._family in ['openbsd', 'freebsd', 'netbsd']:
return "bsd"
if self._family in ['darwin']:
return "macos"
return "other"
def is_windows(self):