mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
Merge pull request #1080 from tb365/bugfix/tb-image-upload-remove-os-type
image upload remove os type
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user