Automatic merge from release/2.5.0 -> release/2.6.0

* commit 'fef1f193a10cc7fd15e78a7b161c885bbf215e4b':
  image os type caseinsensitive
This commit is contained in:
邱剑
2019-01-15 12:03:31 +08:00
+1 -1
View File
@@ -463,7 +463,7 @@ func (this *ImageManager) _create(s *mcclient.ClientSession, params jsonutils.JS
if err != nil {
return nil, httperrors.NewMissingParameterError("os_type")
}
if !utils.IsInStringArray(osType, []string{"Windows", "Linux", "Freebsd", "Android", "macOS", "VMWare"}) {
if !utils.IsInStringArray(strings.ToLower(osType), []string{"windows", "linux", "freebsd", "android", "macos", "vmware"}) {
return nil, fmt.Errorf("OS type must be specified")
}
name, _ := params.GetString("name")