mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #53 in YUNIONIO/onecloud from ~WANYAOQI/onecloud:feature/wyq/kvm-server-rebuild-root to release/2.1.0
* commit 'baa7b9e09330352afd2e1088a9f1b837cb12bd09': region: server-rebuid-root and fix bug on disk create and disk create failed
This commit is contained in:
@@ -307,7 +307,7 @@ func execITask(taskValue reflect.Value, task *STask, data jsonutils.JSONObject,
|
||||
|
||||
var stageName string
|
||||
if taskFailed {
|
||||
stageName = fmt.Sprintf("%s_failed", task.Stage)
|
||||
stageName = fmt.Sprintf("%sFailed", task.Stage)
|
||||
} else {
|
||||
stageName = task.Stage
|
||||
}
|
||||
@@ -315,6 +315,10 @@ func execITask(taskValue reflect.Value, task *STask, data jsonutils.JSONObject,
|
||||
funcValue := taskValue.MethodByName(stageName)
|
||||
|
||||
if !funcValue.IsValid() || funcValue.IsNil() {
|
||||
log.Debugf("Stage %s not found, try kebab to camel and find again", stageName)
|
||||
if taskFailed {
|
||||
stageName = fmt.Sprintf("%s_failed", task.Stage)
|
||||
}
|
||||
stageName = utils.Kebab2Camel(stageName, "_")
|
||||
funcValue = taskValue.MethodByName(stageName)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user