This repository was archived by the owner on Jan 22, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,20 +105,30 @@ def pretty_os_list():
105105 return ret
106106
107107 @staticmethod
108- def list_os_types ():
109- return osdict .sort_helper (Guest ._OS_TYPES )
108+ def list_os_types (supported = False ):
109+ vals = osdict .sort_helper (Guest ._OS_TYPES )
110+ for t in vals [:]:
111+ if not Guest .list_os_variants (t , supported = supported ):
112+ vals .remove (t )
113+ return vals
110114
111115 @staticmethod
112- def list_os_variants (type , sortpref = None ):
116+ def list_os_variants (type , sortpref = None , supported = False ):
113117 """
114118 Return a list of sorted os variants for the passed distro type
115119
116120 @param sortpref: An option list of osdict 'distro' tags to
117121 prioritize in the returned list, e.g. passing ["fedora"] will make
118122 the sorted list have all fedora distros first
119123 """
120- return osdict .sort_helper (Guest ._OS_TYPES [type ]["variants" ],
124+ vals = osdict .sort_helper (Guest ._OS_TYPES [type ]["variants" ],
121125 sortpref )
126+ for v in vals [:]:
127+ if (supported and
128+ not osdict .lookup_osdict_key (None , None ,
129+ type , v , "supported" )):
130+ vals .remove (v )
131+ return vals
122132
123133 @staticmethod
124134 def get_os_type_label (type ):
You can’t perform that action at this time.
0 commit comments