Merge pull request #567 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:feature/qj-esxi-support-complete to release/2.4.0

* commit 'aaaba6002fb2773d7e05f2353abad494addb3c18':
  fix aliyun fail to attach disk after create disk
  minor fixes
  update vendor
  fix aliyun error code handling changes, use error message string to check message type
  修正:1. host request double token 2. cloud provider lost access url
  backport remove sysutils
  update vendor
  remote sysutils
  esxi support
  temp commit
This commit is contained in:
邱剑
2018-11-27 18:07:52 +08:00
136 changed files with 6202 additions and 2181 deletions
+3
View File
@@ -2,6 +2,7 @@ package taskman
import (
"context"
"net/http"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -14,6 +15,8 @@ type ITask interface {
GetTaskId() string
SetStage(stageName string, data *jsonutils.JSONDict)
GetTaskRequestHeader() http.Header
SetStageComplete(ctx context.Context, data *jsonutils.JSONDict)
SetStageFailed(ctx context.Context, reason string)
}
+9 -1
View File
@@ -427,7 +427,7 @@ func execITask(taskValue reflect.Value, task *STask, odata jsonutils.JSONObject,
return
}
log.Debugf("Call %s %s", task.TaskName, stageName)
log.Debugf("Call %s %s %#v", task.TaskName, stageName, params)
funcValue.Call(params)
// call save request context
@@ -652,3 +652,11 @@ func (self *STask) GetObject() db.IStandaloneModel {
func (self *STask) GetObjects() []db.IStandaloneModel {
return self.taskObjects
}
func (task *STask) GetTaskRequestHeader() http.Header {
header := http.Header{}
header.Set(mcclient.AUTH_TOKEN, task.GetUserCred().GetTokenString())
header.Set(mcclient.TASK_ID, task.GetTaskId())
header.Set(mcclient.REGION_VERSION, "v2")
return header
}