@@ -167,7 +167,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentCreate(d *schema.ResourceDa
167
167
if task == nil {
168
168
return fmt .Errorf ("task is nil" )
169
169
}
170
- if task .Status != nil && * task .Status == "Failed" {
170
+ if task .Status != nil && * task .Status == TASK_STATUS_FAILED {
171
171
if task .FailureReason != nil {
172
172
return fmt .Errorf ("CreateRoleAssignment failed, failure reason:%s" , * task .FailureReason )
173
173
}
@@ -179,7 +179,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentCreate(d *schema.ResourceDa
179
179
}
180
180
taskId := * task .TaskId
181
181
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 {}))
183
183
if _ , e := conf .WaitForState (); e != nil {
184
184
return e
185
185
}
@@ -320,7 +320,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentDelete(d *schema.ResourceDa
320
320
return fmt .Errorf ("delete role assignment task is nil" )
321
321
}
322
322
task := deleteRoleAssignmentResponse .Response .Task
323
- if task .Status != nil && * task .Status == "Failed" {
323
+ if task .Status != nil && * task .Status == TASK_STATUS_FAILED {
324
324
if task .FailureReason != nil {
325
325
return fmt .Errorf ("DeleteRoleAssignment failed, failure reason:%s" , * task .FailureReason )
326
326
}
@@ -353,7 +353,7 @@ func resourceTencentCloudIdentityCenterRoleAssignmentDelete(d *schema.ResourceDa
353
353
}
354
354
355
355
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 {}))
357
357
if _ , e := conf .WaitForState (); e != nil {
358
358
return e
359
359
}
0 commit comments