Merge pull request #1080 from tb365/bugfix/tb-image-upload-remove-os-type

image upload remove os type
This commit is contained in:
yunion-ci-robot
2019-06-05 17:51:50 +08:00
committed by GitHub
2 changed files with 0 additions and 10 deletions
-3
View File
@@ -316,9 +316,6 @@ func init() {
// if len(args.Format) == 0 {
// return fmt.Errorf("Please specify image format")
//}
if len(args.OsType) == 0 {
return fmt.Errorf("Please specify OS type")
}
err := addImageOptionalOptions(s, params, args.ImageOptionalOptions)
if err != nil {
return err
-7
View File
@@ -455,13 +455,6 @@ func (this *ImageManager) _create(s *mcclient.ClientSession, params jsonutils.JS
path := fmt.Sprintf("/%s", this.URLPath())
method := httputils.POST
if len(imageId) == 0 {
osType, err := params.GetString("properties", "os_type")
if err != nil {
return nil, httperrors.NewMissingParameterError("os_type")
}
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")
if len(name) == 0 {
return nil, httperrors.NewMissingParameterError("name")