Commit 119c15d6 authored by Benjamin Blanc's avatar Benjamin Blanc

erp5_bootstrap: Hack to don't wait for the persistent Alarm_installMailServer activity

parent 4c1259c0
...@@ -27,6 +27,12 @@ def getConnection(): ...@@ -27,6 +27,12 @@ def getConnection():
else: else:
raise ValueError("Protocol not implemented") raise ValueError("Protocol not implemented")
def testIfExist(page, unexcepted_content="Site Error"):
zope_connection = getConnection()
zope_connection.request('GET', '/%%s/%%s' %%(site_id, page))
result = zope_connection.getresponse()
return not unexcepted_content in result.read()
def waitFor0PendingActivities(): def waitFor0PendingActivities():
# TODO: tolerate 1 pending activities ? (mail server...) # TODO: tolerate 1 pending activities ? (mail server...)
start_time = time.time() start_time = time.time()
...@@ -44,11 +50,11 @@ def waitFor0PendingActivities(): ...@@ -44,11 +50,11 @@ def waitFor0PendingActivities():
print "There is %%d pending activities" %%len(message_list) print "There is %%d pending activities" %%len(message_list)
time.sleep(5) time.sleep(5)
def testIfExist(page, unexcepted_content="Site Error"): #Hack to do not take into account persistent Alarm_installMailServer acitivities
zope_connection = getConnection() if len(message_list)==0 and testIfExist("/%%s/portal_activities" %%site_id, "Alarm_installMailServer"):
zope_connection.request('GET', '/%%s/%%s' %%(site_id, page)) print "1 pending activity for 'Alarm_installMailServer'."
result = zope_connection.getresponse() print "ok."
return not unexcepted_content in result.read() break
# Check if an ERP5 site is already created, as ERP5 does support having # Check if an ERP5 site is already created, as ERP5 does support having
...@@ -102,7 +108,7 @@ if scalability: ...@@ -102,7 +108,7 @@ if scalability:
and not testIfExist("/%%s/sale_order_module/" %%site_id): and not testIfExist("/%%s/sale_order_module/" %%site_id):
zope_connection = getConnection() zope_connection = getConnection()
zope_connection.request( zope_connection.request(
'GET', '/%%s/business_configuration_module/1/build' %%(business_object_name, site_id), 'GET', '/%%s/business_configuration_module/1/build' %%site_id,
headers=header_dict headers=header_dict
) )
print "Build scalability business configuration..." print "Build scalability business configuration..."
......
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