Commit 2970d30a authored by Benjamin Blanc's avatar Benjamin Blanc

erp5_bootstrap: add controls

parent acb48fb1
...@@ -60,7 +60,8 @@ def waitFor0PendingActivities(): ...@@ -60,7 +60,8 @@ def waitFor0PendingActivities():
print "waitFor0PendingActivities.." print "waitFor0PendingActivities.."
start_time = time.time() start_time = time.time()
count = 0 count = 0
while MAX_INSTALLATION_TIME > time.time()-start_time: ok = False
while MAX_INSTALLATION_TIME > time.time()-start_time and not ok:
try: try:
count = count + 1 count = count + 1
zope_connection = getConnection() zope_connection = getConnection()
...@@ -71,21 +72,24 @@ def waitFor0PendingActivities(): ...@@ -71,21 +72,24 @@ def waitFor0PendingActivities():
result = zope_connection.getresponse() result = zope_connection.getresponse()
message_list_text = result.read() message_list_text = result.read()
message_list = [s.strip() for s in message_list_text[1:-1].split(',')] message_list = [s.strip() for s in message_list_text[1:-1].split(',')]
if len(message_list)==0: if len(message_list)==0:
print "There is no pending activities." print "There is no pending activities."
break ok = True
print "There is %%d pending activities" %%len(message_list)
time.sleep(5)
#Hack to do not take into account persistent Alarm_installMailServer acitivities #Hack to do not take into account persistent Alarm_installMailServer acitivities
if len(message_list)==1: if len(message_list)==1:
print "1 pending activity for 'Alarm_installMailServer'." print "1 pending activity for 'Alarm_installMailServer'."
print "ok." print "ok."
break ok = True
print "There is %%d pending activities" %%len(message_list)
time.sleep(5)
except: except:
time.sleep(5) time.sleep(5)
print "Getting activities failed, retry." print "Getting activities failed, retry."
if not ok:
raise ValueError("Pending activities always here after %%d check/try (for %%s s)" %%(count, str(time.time()-start_time))) raise ValueError("Pending activities always here after %%d check/try (for %%s s)" %%(count, str(time.time()-start_time)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment