fix(region): Fix problems for Auto Scaling

1. ScalingPolicyManager and ScalingActivityManager override ResourceScope.
2. Change 'tenant' as 'project_id' before requesting to forcast.
This commit is contained in:
Rain
2020-04-22 16:30:46 +08:00
parent 3d70163ee9
commit 4f27908fff
3 changed files with 13 additions and 2 deletions
+3 -2
View File
@@ -415,6 +415,7 @@ func (asc *SASController) createInstances(session *mcclient.ClientSession, param
clientErr := err.(*httputils.JSONClientError)
failedList = append(failedList, clientErr.Details)
}
dict.Remove("domain_id")
dict.Remove("count")
if count == 1 {
@@ -471,8 +472,8 @@ func (asc *SASController) CreateInstances(
// For compatibility
content.Remove("__count__")
// set onwer project and id
content.Set("tenant", jsonutils.NewString(ownerId.GetProjectId()))
content.Set("user", jsonutils.NewString(ownerId.GetUserId()))
content.Set("project_id", jsonutils.NewString(ownerId.GetProjectId()))
content.Set("user_id", jsonutils.NewString(ownerId.GetUserId()))
countPR, requests := asc.countPRAndRequests(num)
log.Debugf("countPR: %d, requests: %d", countPR, requests)