UpdateOpts not optional

This commit is contained in:
Jon Perritt 2015-01-31 17:55:42 -07:00
parent 3427597bd0
commit fa15d41d45
1 changed files with 8 additions and 18 deletions

View File

@ -171,25 +171,15 @@ func resourceLBMonitorV1Update(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error creating OpenStack networking client: %s", err) return fmt.Errorf("Error creating OpenStack networking client: %s", err)
} }
var updateOpts monitors.UpdateOpts updateOpts := monitors.UpdateOpts{
if d.HasChange("delay") { Delay: d.Get("delay").(int),
updateOpts.Delay = d.Get("delay").(int) Timeout: d.Get("timeout").(int),
} MaxRetries: d.Get("max_retries").(int),
if d.HasChange("timeout") { URLPath: d.Get("url_path").(string),
updateOpts.Timeout = d.Get("timeout").(int) HTTPMethod: d.Get("http_method").(string),
} ExpectedCodes: d.Get("expected_codes").(string),
if d.HasChange("max_retries") {
updateOpts.MaxRetries = d.Get("max_retries").(int)
}
if d.HasChange("url_path") {
updateOpts.URLPath = d.Get("url_path").(string)
}
if d.HasChange("http_method") {
updateOpts.HTTPMethod = d.Get("http_method").(string)
}
if d.HasChange("expected_codes") {
updateOpts.ExpectedCodes = d.Get("expected_codes").(string)
} }
if d.HasChange("admin_state_up") { if d.HasChange("admin_state_up") {
asuRaw := d.Get("admin_state_up").(string) asuRaw := d.Get("admin_state_up").(string)
if asuRaw != "" { if asuRaw != "" {