From bd3103bc81c422bb65d69f149597afbc5b88708b Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Fri, 12 Sep 2014 11:22:08 +0300
Subject: [PATCH] windows: Increase the connection check interval

Start by waiting for 5sec before retrying and double the interval
after each retry.
---
 image_creator/os_type/windows/__init__.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/image_creator/os_type/windows/__init__.py b/image_creator/os_type/windows/__init__.py
index 9cdf76a..b656ce6 100644
--- a/image_creator/os_type/windows/__init__.py
+++ b/image_creator/os_type/windows/__init__.py
@@ -701,7 +701,7 @@ class Windows(OSBase):
         """Check if winexe works on the Windows VM"""
 
         retries = self.sysprep_params['connection_retries'].value
-        timeout = [2]
+        timeout = [5]
         for i in xrange(1, retries - 1):
             timeout.insert(0, timeout[0] * 2)
 
@@ -724,8 +724,9 @@ class Windows(OSBase):
                 log.close()
             self.out.output("failed! See: `%s' for the full output" % log.name)
             if i < retries - 1:
-                self.out.output("retrying ...", False)
-                time.sleep(timeout.pop())
+                wait = timeout.pop()
+                self.out.output("retrying in %d seconds ..." % wait, False)
+                time.sleep(wait)
 
         raise FatalError("Connection to the Windows VM failed after %d retries"
                          % retries)
-- 
GitLab