mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #925 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-os-type-case-insensitive to release/2.5.0
* commit '98bbe1a5c3d54dfb786729e82d6abaa6dc2c0a6d': image os type caseinsensitive
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user