Commit 6ba2bdc2 authored by Iustin Pop's avatar Iustin Pop
Browse files

Disallow variants for OSes that don't support them

Otherwise we get no variant checks at all, but the variant is still
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 732052c1
......@@ -1097,9 +1097,13 @@ def _CheckOSVariant(os_obj, name):
@param name: OS name passed by the user, to check for validity
variant = objects.OS.GetVariant(name)
if not os_obj.supported_variants:
if variant:
raise errors.OpPrereqError("OS '%s' doesn't support variants ('%s'"
" passed)" % (, variant),
variant = objects.OS.GetVariant(name)
if not variant:
raise errors.OpPrereqError("OS name must include a variant",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment