Revision 6ba2bdc2

b/lib/cmdlib.py
1097 1097
  @param name: OS name passed by the user, to check for validity
1098 1098

  
1099 1099
  """
1100
  variant = objects.OS.GetVariant(name)
1100 1101
  if not os_obj.supported_variants:
1102
    if variant:
1103
      raise errors.OpPrereqError("OS '%s' doesn't support variants ('%s'"
1104
                                 " passed)" % (os_obj.name, variant),
1105
                                 errors.ECODE_INVAL)
1101 1106
    return
1102
  variant = objects.OS.GetVariant(name)
1103 1107
  if not variant:
1104 1108
    raise errors.OpPrereqError("OS name must include a variant",
1105 1109
                               errors.ECODE_INVAL)

Also available in: Unified diff