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

provider: Deprecate maxRetryTimeout in favour of max_retry_timeout #40

Merged
merged 1 commit into from
Aug 10, 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
15 changes: 14 additions & 1 deletion vcd/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func Provider() terraform.ResourceProvider {
},

"maxRetryTimeout": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Deprecated: "Deprecated. Use max_retry_timeout instead.",
},

"max_retry_timeout": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("VCD_MAX_RETRY_TIMEOUT", 60),
Expand Down Expand Up @@ -74,13 +80,20 @@ func Provider() terraform.ResourceProvider {
}

func providerConfigure(d *schema.ResourceData) (interface{}, error) {
maxRetryTimeout := d.Get("max_retry_timeout").(int)

// TODO: Deprecated, remove in next major release
if v, ok := d.GetOk("maxRetryTimeout"); ok {
maxRetryTimeout = v.(int)
}

config := Config{
User: d.Get("user").(string),
Password: d.Get("password").(string),
Org: d.Get("org").(string),
Href: d.Get("url").(string),
VDC: d.Get("vdc").(string),
MaxRetryTimeout: d.Get("maxRetryTimeout").(int),
MaxRetryTimeout: maxRetryTimeout,
InsecureFlag: d.Get("allow_unverified_ssl").(bool),
}

Expand Down
7 changes: 4 additions & 3 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ provider "vcd" {
org = "${var.vcd_org}"
url = "${var.vcd_url}"
vdc = "${var.vcd_vdc}"
maxRetryTimeout = "${var.vcd_maxRetryTimeout}"
max_retry_timeout = "${var.vcd_max_retry_timeout}"
allow_unverified_ssl = "${var.vcd_allow_unverified_ssl}"
}

Expand All @@ -51,12 +51,13 @@ The following arguments are used to configure the VMware vCloud Director Provide
API operations against. If not set the plugin will select the first virtual
datacenter available to your Org. Can also be specified with the `VCD_VDC` environment
variable.
* `maxRetryTimeout` - (Optional) This provides you with the ability to specify the maximum
* `max_retry_timeout` - (Optional) This provides you with the ability to specify the maximum
amount of time (in seconds) you are prepared to wait for interactions on resources managed
by vCloud Director to be successful. If a resource action fails, the action will be retried
(as long as it is still within the `maxRetryTimeout` value) to try and ensure success.
(as long as it is still within the `max_retry_timeout` value) to try and ensure success.
Defaults to 60 seconds if not set.
Can also be specified with the `VCD_MAX_RETRY_TIMEOUT` environment variable.
* `maxRetryTimeout` - (Deprecated) Use `max_retry_timeout` instead.
* `allow_unverified_ssl` - (Optional) Boolean that can be set to true to
disable SSL certificate verification. This should be used with care as it
could allow an attacker to intercept your auth token. If omitted, default
Expand Down