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

Fix the exception of empty value conversion #1205

Merged
merged 1 commit into from
Jun 11, 2021
Merged

Fix the exception of empty value conversion #1205

merged 1 commit into from
Jun 11, 2021

Conversation

Lance52259
Copy link
Contributor

@Lance52259 Lance52259 commented Jun 9, 2021

What this PR does / why we need it:

  • When using d.get ("db.0.port").(int) to get an optional parameter that is not set, a zero value is obtained.
    d.GetOK() method can be successfully to fix it.
  • Two resources with this problem:
    • huaweicloud_gaussdb_cassandra_instance
    • huaweicloud_rds_instance

Which issue this PR fixes:
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
fixes #1204

Special notes for your reviewer:

Release note:

1. check the value whether is exist before conversion.

PR Checklist

  • Tests added/passed.
  • Documentation updated.
  • Schema updated.

Acceptance Steps Performed

make testacc TEST='./huaweicloud' TESTARGS='-run=TestAccGeminiDBInstance_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud -v -run=TestAccGeminiDBInstance_basic -timeout 360m -parallel 4
=== RUN   TestAccGeminiDBInstance_basic
=== PAUSE TestAccGeminiDBInstance_basic
=== CONT  TestAccGeminiDBInstance_basic
--- PASS: TestAccGeminiDBInstance_basic (1107.38s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud       1107.425s

@Lance52259 Lance52259 changed the title Fix the exception of zero value conversion Fix the exception of empty value conversion Jun 9, 2021
@ShiChangkuo ShiChangkuo merged commit 50ab080 into huaweicloud:master Jun 11, 2021
@Lance52259 Lance52259 deleted the br_strconv_err_active branch June 22, 2021 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using strconv.Itoa to set optional parameter will create a empty value
2 participants