Skip to content

Commit f17f50e

Browse files
authored
fix(vpc): [123456789] tencentcloud_vpn_customer_gateway update code (#3343)
* add * add
1 parent 9bfbdee commit f17f50e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.changelog/3343.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_vpn_customer_gateway: update code
3+
```

tencentcloud/services/vpn/resource_tc_vpn_customer_gateway.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ func resourceTencentCloudVpnCustomerGatewayRead(d *schema.ResourceData, meta int
178178
if ee.Code == svcvpc.VPCNotFound {
179179
log.Printf("[CRITAL]%s api[%s] success, request body [%s], reason[%s]\n",
180180
logId, request.GetAction(), request.ToJsonString(), e.Error())
181-
d.SetId("")
182-
return resource.NonRetryableError(fmt.Errorf("Vpc not found."))
181+
return nil
183182
} else {
184183
log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n",
185184
logId, request.GetAction(), request.ToJsonString(), e.Error())
@@ -200,7 +199,7 @@ func resourceTencentCloudVpnCustomerGatewayRead(d *schema.ResourceData, meta int
200199
return err
201200
}
202201

203-
if len(response.Response.CustomerGatewaySet) < 1 {
202+
if response == nil || response.Response == nil || len(response.Response.CustomerGatewaySet) < 1 {
204203
d.SetId("")
205204
return nil
206205
}

0 commit comments

Comments
 (0)