CC-2870: Create testing infrastructure for testing upgrades

-try multiple times until ip address acquired.
This commit is contained in:
Martin Konecny 2011-11-09 17:50:51 -05:00
parent 8a737d58f5
commit cec90ddf70
1 changed files with 10 additions and 6 deletions

View File

@ -98,12 +98,16 @@ def create_fresh_os(os_version, os_arch):
print "Please wait while attempting to acquire IP address" print "Please wait while attempting to acquire IP address"
time.sleep(30) time.sleep(30)
ret = local('VBoxManage --nologo guestproperty get "%s" /VirtualBox/GuestInfo/Net/0/V4/IP'%vm_name, capture=True) try_again = True
while try_again:
triple = ret.partition(':') ret = local('VBoxManage --nologo guestproperty get "%s" /VirtualBox/GuestInfo/Net/0/V4/IP'%vm_name, capture=True)
ip_addr = triple[2].strip(' \r\n') triple = ret.partition(':')
print "Address found %s"%ip_addr ip_addr = triple[2].strip(' \r\n')
print "Address found %s"%ip_addr
try_again = (len(ip_addr) == 0)
env.hosts.append(ip_addr) env.hosts.append(ip_addr)
env.host_string = ip_addr env.host_string = ip_addr