From 0ceb78814700ebd1e2f07286333f01b3c3170f24 Mon Sep 17 00:00:00 2001 From: Minsik Lee Date: Thu, 27 Oct 2016 10:14:27 -0400 Subject: [PATCH] Fix VPX REST status checking logic for VPX 10.5. (#42) --- softlayer/resource_softlayer_lb_vpx.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/softlayer/resource_softlayer_lb_vpx.go b/softlayer/resource_softlayer_lb_vpx.go index abbac5491..b29d1e6a2 100644 --- a/softlayer/resource_softlayer_lb_vpx.go +++ b/softlayer/resource_softlayer_lb_vpx.go @@ -424,13 +424,15 @@ func resourceSoftLayerLbVpxCreate(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Failed to create VIPs for Netscaler VPX ID: %d", id) } - // Wait VPX service initializing. GetLoadBalancers() internally calls REST API of VPX and returns an error - // if the REST API is not available. + // Wait while VPX service is initializing. GetLoadBalancers() internally calls REST API of VPX and returns + // an error "Could not connect to host" if the REST API is not available. IsRESTReady := false for restWaitCount := 0; restWaitCount < 60; restWaitCount++ { _, err := NADCService.Id(id).GetLoadBalancers() - if err == nil { + // GetLoadBalancers returns an error "There was a problem processing the reply from the + // application tier. Please contact development." if the VPX version is 10.5. + if err == nil || !strings.Contains(err.Error(), "Could not connect to host") { IsRESTReady = true break }