provider/openstack: gophercloud migration: Fixing persistence update in lbaasv1

This commit is contained in:
Joe Topjian 2016-10-16 02:02:12 +00:00
parent fbcd8f105b
commit 1fce3ed9fd
2 changed files with 4 additions and 5 deletions

View File

@ -221,10 +221,6 @@ func resourceLBVipV1Update(d *schema.ResourceData, meta interface{}) error {
updateOpts.Description = &v
}
if d.HasChange("persistence") {
updateOpts.Persistence = resourceVipPersistenceV1(d)
}
if d.HasChange("conn_limit") {
updateOpts.ConnLimit = gophercloud.MaybeInt(d.Get("conn_limit").(int))
}
@ -268,6 +264,9 @@ func resourceLBVipV1Update(d *schema.ResourceData, meta interface{}) error {
updateOpts.AdminStateUp = &asu
}
// Persistence has to be included, even if it hasn't changed.
updateOpts.Persistence = resourceVipPersistenceV1(d)
log.Printf("[DEBUG] Updating OpenStack LB VIP %s with options: %+v", d.Id(), updateOpts)
_, err = vips.Update(networkingClient, d.Id(), updateOpts).Extract()

View File

@ -152,9 +152,9 @@ var testAccLBV1VIP_update = fmt.Sprintf(`
protocol = "HTTP"
port = 80
pool_id = "${openstack_lb_pool_v1.pool_1.id}"
admin_state_up = true
persistence {
type = "SOURCE_IP"
}
admin_state_up = true
}`,
OS_REGION_NAME, OS_REGION_NAME, OS_REGION_NAME)