Iterate one more time before failing iso download

Signed-off-by: sanjeev <sanj...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/67268d9d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/67268d9d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/67268d9d

Branch: refs/heads/hotfix/scp-exception
Commit: 67268d9db308f8597a01093ba7498ace3c153df4
Parents: a7b8e98
Author: sanjeev <sanj...@apache.org>
Authored: Wed Feb 4 15:24:07 2015 +0530
Committer: sanjeev <sanj...@apache.org>
Committed: Mon Feb 16 12:16:21 2015 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/lib/base.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67268d9d/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index 5bad6b7..7443373 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -1343,6 +1343,7 @@ class Iso:
     def download(self, apiclient, timeout=5, interval=60):
         """Download an ISO"""
         # Ensuring ISO is successfully downloaded
+        retry = 1
         while True:
             time.sleep(interval)
 
@@ -1360,6 +1361,9 @@ class Iso:
                     return
                 elif 'Downloaded' not in response.status and \
                         'Installing' not in response.status:
+                    if retry == 1:
+                        retry = retry - 1
+                        continue
                     raise Exception(
                         "Error In Downloading ISO: ISO Status - %s" %
                         response.status)

Reply via email to