[Erp5-report] r44143 rafael - /erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Mar 10 16:42:42 CET 2011
Author: rafael
Date: Thu Mar 10 16:42:42 2011
New Revision: 44143
URL: http://svn.erp5.org?rev=44143&view=rev
Log:
Provide the erp5 site id as parameter.
Modified:
erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py
erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/erp5.py
Modified: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py?rev=44143&r1=44142&r2=44143&view=diff
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] Thu Mar 10 16:42:42 2011
@@ -40,6 +40,8 @@ CONFIG = dict(
test_ca_prefix='test_ca',
# Zope
zope_user='zope',
+ # ERP5
+ erp5_site_id='erp5',
# MySQL
mysql_database='erp5',
mysql_port=45678,
@@ -386,21 +388,23 @@ class Recipe(BaseSlapRecipe):
def installERP5Site(self):
""" Create a script controlled by supervisor, which creates a erp5
site on current available zope and mysql environment"""
+ erp5_site_id = CONFIG['erp5_site_id']
mysql_connection_string = "%s@%s:%s %s %s" % (CONFIG['mysql_database'],
CONFIG['mysql_ip'],
CONFIG['mysql_port'],
CONFIG['mysql_user'],
CONFIG['mysql_password'])
- https_connection_url = "https://%s:%s@%s:%s/" % (CONFIG['zope_user'],
- CONFIG['zope_password'],
+ https_connection_url = "https://%s:%s@%s:%s/" % (self.connection_dict['zope_user'],
+ self.connection_dict['zope_password'],
self.backend_ip,
self.backend_port)
self.path_list.extend(zc.buildout.easy_install.scripts([('erp5_update',
__name__ + '.erp5', 'updateERP5')], self.ws,
sys.executable, self.wrapper_directory,
- arguments=[mysql_connection_string, https_connection_url]))
+ arguments=[erp5_site_id, mysql_connection_string,
+ https_connection_url]))
return []
Modified: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/erp5.py
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/erp5.py?rev=44143&r1=44142&r2=44143&view=diff
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/erp5.py [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/erp5.py [utf8] Thu Mar 10 16:42:42 2011
@@ -28,26 +28,26 @@ import time
import urllib
def updateERP5(args):
- base_url = args[1]
- mysql_string = args[0]
+ base_url = args[2]
+ mysql_string = args[1]
+ site_id = args[0]
sleep = 30
while True:
try:
- url = '%s/erp5/getId' % base_url
- result = urllib.urlopen(url).read()
+ test_url = '%s/%s/getId' % (base_url, site_id)
+ result = urllib.urlopen(test_url).read()
# XXX This result should be more assertive
- if result != 'erp5':
+ if result != site_id:
url = '%s/manage_addProduct/ERP5/manage_addERP5Site' % base_url
result = urllib.urlopen(url, urllib.urlencode({
- "id": "erp5",
+ "id": site_id,
"erp5_sql_connection_string": mysql_string,
"cmf_activity_sql_connection_string": mysql_string, }))
print result.read()
- url = '%s/erp5/getId' % base_url
- result = urllib.urlopen(url).read()
+ result = urllib.urlopen(test_url).read()
- if result == 'erp5':
+ if result == site_id:
print "Ready for install one business."
# XXX Suggestion for future
# POST '%s/erp5/portal_templates/updateRepositoryBusinessTemplateList <
More information about the Erp5-report
mailing list