diff options
author | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2016-05-22 01:29:54 +0200 |
---|---|---|
committer | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2016-05-22 01:29:54 +0200 |
commit | b7f95464d5ab9df695414d976f026f262b8d246d (patch) | |
tree | 890f420caff966b0323e31a6691feefcda9039a3 /libvirt/utils.go | |
parent | c1ee126e821b1a13aca72e3380f3873f3bc1d9a0 (diff) | |
download | terraform-provider-libvirt-b7f95464d5ab9df695414d976f026f262b8d246d.tar terraform-provider-libvirt-b7f95464d5ab9df695414d976f026f262b8d246d.tar.gz |
Another instance where pool refresh fails.
We retry blindly for success until timeout. Unfortunately we can't do the
right thing because libvirt (for some reason) returns VIR_ERR_INTERNAL_ERROR
instead of the expected VIR_ERR_RESOURCE_BUSY.
Closes #16
Diffstat (limited to 'libvirt/utils.go')
-rw-r--r-- | libvirt/utils.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libvirt/utils.go b/libvirt/utils.go index ffaa8ba6..ed645938 100644 --- a/libvirt/utils.go +++ b/libvirt/utils.go @@ -3,6 +3,7 @@ package libvirt import ( "crypto/rand" "fmt" + "log" "time" ) @@ -29,6 +30,7 @@ func WaitForSuccess(errorMessage string, f func() error) error { if err == nil { return nil } + log.Printf("[DEBUG] %s. Re-trying.\n", err) time.Sleep(1 * time.Second) if time.Since(start) > 5*time.Minute { |