Skip to content

Commit

Permalink
Added retry of test_lab on failure of first attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
nrchandan committed Feb 1, 2014
1 parent 4c24b11 commit 3c2a8db
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import logging
import time

import LabManager
import VMPoolManager
Expand All @@ -18,20 +19,19 @@ def __init__(self):
pass

def test_lab(self, lab_id, lab_src_url, version=None):
print "Controller.test_lab()"
OVPL_LOGGER.debug("Controller.test_lab()")
try:
lab_spec = LabManager.get_lab_reqs(lab_id, lab_src_url, version)
vmpoolmgr = VMPoolManager.VMPoolManager()
(ip, port) = vmpoolmgr.create_vm(lab_spec)
#(ip, port) = ("10.4.14.22", "8089")
#(ip, port) = ("10.4.14.39", "8089")
vmmgrurl = "http://" + ip

print 'created vm ', ip, port
print "vm manager url is :", vmmgrurl
print "vm mgr port is :", port
print "lab src url is: ", lab_src_url
#time.sleep(10)
if LabManager.test_lab(vmmgrurl, port, lab_src_url, version):
return ip
elif LabManager.test_lab(vmmgrurl, port, lab_src_url, version):
# retry seems to work (always?)
return ip
else:
return "Test failed"
except Exception, e:
Expand Down

0 comments on commit 3c2a8db

Please sign in to comment.