Commit 5e6048f8 authored by Rafael Monnerat's avatar Rafael Monnerat

Post External Services information to ERP5Site_assertExternalServiceList script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44479 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 391b17ea
...@@ -70,8 +70,8 @@ class Recipe(BaseSlapRecipe): ...@@ -70,8 +70,8 @@ class Recipe(BaseSlapRecipe):
apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(), apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(),
port=13000, backend=zope_access, key=ca_conf['login_key'], port=13000, backend=zope_access, key=ca_conf['login_key'],
certificate=ca_conf['login_certificate'])) certificate=ca_conf['login_certificate']))
self.installERP5Site(user, password, zope_access, self.installERP5Site(user, password, zope_access, mysql_conf,
mysql_conf, conversion_server_conf, memcached_conf, self.site_id) conversion_server_conf, memcached_conf, kumo_conf, self.site_id)
self.installTestRunner(ca_conf, mysql_conf, conversion_server_conf) self.installTestRunner(ca_conf, mysql_conf, conversion_server_conf)
self.linkBinary() self.linkBinary()
self.setConnectionDict(dict( self.setConnectionDict(dict(
...@@ -334,13 +334,17 @@ class Recipe(BaseSlapRecipe): ...@@ -334,13 +334,17 @@ class Recipe(BaseSlapRecipe):
return user, password return user, password
def installERP5Site(self, user, password, zope_access, mysql_conf, def installERP5Site(self, user, password, zope_access, mysql_conf,
conversion_server_conf=None, memcached_conf=None, erp5_site_id='erp5'): conversion_server_conf=None, memcached_conf=None, kumo_conf=None, erp5_site_id='erp5'):
""" Create a script controlled by supervisor, which creates a erp5 """ Create a script controlled by supervisor, which creates a erp5
site on current available zope and mysql environment""" site on current available zope and mysql environment"""
if conversion_server_conf is None: conversion_server = None
conversion_server_conf = {} if conversion_server_conf is not None:
conversion_server = "%s:%s" % (conversion_server_conf['conversion_server_ip'],
conversion_server_conf['conversion_server_port'])
if memcached_conf is None: if memcached_conf is None:
memcached_conf = {} memcached_conf = {}
if kumo_conf is None:
kumo_conf = {}
# XXX Conversion server and memcache server coordinates are not relevant # XXX Conversion server and memcache server coordinates are not relevant
# for pure site creation. # for pure site creation.
https_connection_url = "http://%s:%s@%s/" % (user, password, zope_access) https_connection_url = "http://%s:%s@%s/" % (user, password, zope_access)
...@@ -359,8 +363,8 @@ class Recipe(BaseSlapRecipe): ...@@ -359,8 +363,8 @@ class Recipe(BaseSlapRecipe):
mysql_connection_string, mysql_connection_string,
https_connection_url, https_connection_url,
memcached_conf.get('memcached_url'), memcached_conf.get('memcached_url'),
conversion_server_conf.get('conversion_server_ip'), conversion_server,
conversion_server_conf.get('conversion_server_port'), kumo_conf.get("kumo_address"),
bt5_list, bt5_list,
bt5_repository_list])) bt5_repository_list]))
return [] return []
......
...@@ -35,8 +35,8 @@ def updateERP5(args): ...@@ -35,8 +35,8 @@ def updateERP5(args):
mysql_string = args[1] mysql_string = args[1]
base_url = args[2] base_url = args[2]
memcached_provider = args[3] memcached_provider = args[3]
conversion_server_address = args[4] conversion_server = args[4]
conversion_server_port = args[5] kumo_provider = args[5]
bt5_list = args[6] bt5_list = args[6]
bt5_repository_list = [] bt5_repository_list = []
if len(args) > 7: if len(args) > 7:
...@@ -46,7 +46,9 @@ def updateERP5(args): ...@@ -46,7 +46,9 @@ def updateERP5(args):
bt5_repository_list = ["http://www.erp5.org/dists/snapshot/bt5"] bt5_repository_list = ["http://www.erp5.org/dists/snapshot/bt5"]
erp5_catalog_storage = "erp5_mysql_innodb_catalog" erp5_catalog_storage = "erp5_mysql_innodb_catalog"
business_template_setup_finished = 0 business_template_setup_finished = 0
sleep = 60 external_service_assertion = 1
update_script_id = "ERP5Site_assertExternalServiceList"
sleep = 120
while True: while True:
try: try:
proxy = xmlrpclib.ServerProxy(base_url) proxy = xmlrpclib.ServerProxy(base_url)
...@@ -87,8 +89,14 @@ def updateERP5(args): ...@@ -87,8 +89,14 @@ def updateERP5(args):
len([i for i in bt5_list if i not in installed_bt5_list]) == 0: len([i for i in bt5_list if i not in installed_bt5_list]) == 0:
print "Repositories updated and business templates installed." print "Repositories updated and business templates installed."
business_template_setup_finished = 1 business_template_setup_finished = 1
else:
print "ERP5 site is already present, ignore." if external_service_assertion:
url = "%s/%s/%s" % (base_url, site_id, update_script_id)
result = urllib.urlopen(url, urllib.urlencode({
"memcached" : memcached_provider,
"kumo" : kumo_provider,
"conversion_server" : conversion_server,})).read()
external_service_assertion = not (result == "True")
except IOError: except IOError:
print "Unable to create the ERP5 Site!" print "Unable to create the ERP5 Site!"
......
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