Example #1
0
func waitForLB(client *gophercloud.ServiceClient, id int, state lbs.Status) {
	gophercloud.WaitFor(60, func() (bool, error) {
		lb, err := lbs.Get(client, id).Extract()
		if err != nil {
			return false, err
		}
		if lb.Status != state {
			return false, nil
		}
		return true, nil
	})
}
Example #2
0
func getLB(t *testing.T, client *gophercloud.ServiceClient, id int) {
	lb, err := lbs.Get(client, id).Extract()
	th.AssertNoErr(t, err)
	t.Logf("Getting LB %d: Created [%s] VIPs [%#v] Logging [%#v] Persistence [%#v] SourceAddrs [%#v]",
		lb.ID, lb.Created, lb.VIPs, lb.ConnectionLogging, lb.SessionPersistence, lb.SourceAddrs)
}