@@ -167,7 +167,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentCreate(d *schema.ResourceDa
167167 if task == nil {
168168 return fmt .Errorf ("task is nil" )
169169 }
170- if task .Status != nil && * task .Status == "Failed" {
170+ if task .Status != nil && * task .Status == TASK_STATUS_FAILED {
171171 if task .FailureReason != nil {
172172 return fmt .Errorf ("CreateRoleAssignment failed, failure reason:%s" , * task .FailureReason )
173173 }
@@ -179,7 +179,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentCreate(d *schema.ResourceDa
179179 }
180180 taskId := * task .TaskId
181181 roleConfigurationId := * task .RoleConfigurationId
182- conf := tccommon .BuildStateChangeConf ([]string {}, []string {"Success" }, 2 * tccommon .ReadRetryTimeout , time .Second , service .AssignmentTaskStatusStateRefreshFunc (zoneId , taskId , []string {}))
182+ conf := tccommon .BuildStateChangeConf ([]string {}, []string {TASK_STATUS_SUCCESS , TASK_STATUS_FAILED }, 2 * tccommon .ReadRetryTimeout , time .Second , service .AssignmentTaskStatusStateRefreshFunc (zoneId , taskId , []string {}))
183183 if _ , e := conf .WaitForState (); e != nil {
184184 return e
185185 }
@@ -320,7 +320,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentDelete(d *schema.ResourceDa
320320 return fmt .Errorf ("delete role assignment task is nil" )
321321 }
322322 task := deleteRoleAssignmentResponse .Response .Task
323- if task .Status != nil && * task .Status == "Failed" {
323+ if task .Status != nil && * task .Status == TASK_STATUS_FAILED {
324324 if task .FailureReason != nil {
325325 return fmt .Errorf ("DeleteRoleAssignment failed, failure reason:%s" , * task .FailureReason )
326326 }
@@ -353,7 +353,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentDelete(d *schema.ResourceDa
353353 }
354354
355355 if dismantleRoleConfigurationResponse .Response != nil && dismantleRoleConfigurationResponse .Response .Task != nil && dismantleRoleConfigurationResponse .Response .Task .TaskId != nil {
356- conf := tccommon .BuildStateChangeConf ([]string {}, []string {"Success" }, 2 * tccommon .ReadRetryTimeout , time .Second , service .AssignmentTaskStatusStateRefreshFunc (zoneId , * dismantleRoleConfigurationResponse .Response .Task .TaskId , []string {}))
356+ conf := tccommon .BuildStateChangeConf ([]string {}, []string {TASK_STATUS_SUCCESS , TASK_STATUS_FAILED }, 2 * tccommon .ReadRetryTimeout , time .Second , service .AssignmentTaskStatusStateRefreshFunc (zoneId , * dismantleRoleConfigurationResponse .Response .Task .TaskId , []string {}))
357357 if _ , e := conf .WaitForState (); e != nil {
358358 return e
359359 }
0 commit comments