Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait use ceate finshed time #126

Merged
merged 1 commit into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion qingcloud/resource_qingcloud_eip_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func getEIPResourceMap(data *qc.EIP) map[string]interface{} {
return a
}
func waitEipLease(d *schema.ResourceData, meta interface{}) error {
if !d.IsNewResource() {
return nil
}
clt := meta.(*QingCloudClient).eip
input := new(qc.DescribeEIPsInput)
input.EIPs = []*string{qc.String(d.Id())}
Expand All @@ -104,7 +107,7 @@ func waitEipLease(d *schema.ResourceData, meta interface{}) error {
return err
}
//wait for lease info
WaitForLease(output.EIPSet[0].CreateTime)
WaitForLease(output.EIPSet[0].StatusTime)
return nil
}

Expand Down
5 changes: 4 additions & 1 deletion qingcloud/resource_qingcloud_instance_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ func updateInstanceVolume(d *schema.ResourceData, meta interface{}) error {
}

func waitInstanceLease(d *schema.ResourceData, meta interface{}) error {
if !d.IsNewResource() {
return nil
}
clt := meta.(*QingCloudClient).instance
input := new(qc.DescribeInstancesInput)
input.Instances = []*string{qc.String(d.Id())}
Expand All @@ -410,7 +413,7 @@ func waitInstanceLease(d *schema.ResourceData, meta interface{}) error {
return err
}
//wait for lease info
WaitForLease(output.InstanceSet[0].CreateTime)
WaitForLease(output.InstanceSet[0].StatusTime)
return nil
}

Expand Down
3 changes: 3 additions & 0 deletions qingcloud/resource_qingcloud_loadbalancer_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func isLoadBalancerDeleted(lbSet []*qc.LoadBalancer) bool {
}

func waitLoadBalancerLease(d *schema.ResourceData, meta interface{}) error {
if !d.IsNewResource() {
return nil
}
clt := meta.(*QingCloudClient).loadbalancer
input := new(qc.DescribeLoadBalancersInput)
input.LoadBalancers = []*string{qc.String(d.Id())}
Expand Down
5 changes: 4 additions & 1 deletion qingcloud/resource_qingcloud_volume_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func changeVolumeSize(d *schema.ResourceData, meta interface{}) error {
}

func waitVolumeLease(d *schema.ResourceData, meta interface{}) error {
if !d.IsNewResource() {
return nil
}
clt := meta.(*QingCloudClient).volume
input := new(qc.DescribeVolumesInput)
input.Volumes = []*string{qc.String(d.Id())}
Expand All @@ -97,6 +100,6 @@ func waitVolumeLease(d *schema.ResourceData, meta interface{}) error {
return err
}
//wait for lease info
WaitForLease(output.VolumeSet[0].CreateTime)
WaitForLease(output.VolumeSet[0].StatusTime)
return nil
}
3 changes: 3 additions & 0 deletions qingcloud/resource_qingcloud_vpc_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func applyRouterUpdate(routerId *string, meta interface{}) error {
}

func waitRouterLease(d *schema.ResourceData, meta interface{}) error {
if !d.IsNewResource() {
return nil
}
clt := meta.(*QingCloudClient).router
input := new(qc.DescribeRoutersInput)
input.Routers = []*string{qc.String(d.Id())}
Expand Down