mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(hostman): fix kvm create disk failed error
This commit is contained in:
@@ -227,10 +227,15 @@ func perfomrDiskActions(ctx context.Context, w http.ResponseWriter, r *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
disk, err := storage.GetDiskById(diskId)
|
||||
if err != nil {
|
||||
hostutils.Response(ctx, w, httperrors.NewGeneralError(errors.Wrapf(err, "GetDiskById(%s)", diskId)))
|
||||
return
|
||||
var disk storageman.IDisk
|
||||
var err error
|
||||
|
||||
if action != "create" {
|
||||
disk, err = storage.GetDiskById(diskId)
|
||||
if err != nil {
|
||||
hostutils.Response(ctx, w, httperrors.NewGeneralError(errors.Wrapf(err, "GetDiskById(%s)", diskId)))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
f, ok := actionFuncs[action]
|
||||
|
||||
Reference in New Issue
Block a user