Commit 14f5fb8f authored by Łukasz Nowak's avatar Łukasz Nowak

Provide erp5 updater in separate recipe.

parent 48d9a1c7
...@@ -89,13 +89,13 @@ class Recipe(BaseSlapRecipe): ...@@ -89,13 +89,13 @@ class Recipe(BaseSlapRecipe):
backend_url=apache_conf['apache_login'], key=frontend_key, backend_url=apache_conf['apache_login'], key=frontend_key,
certificate=frontend_certificate) certificate=frontend_certificate)
default_bt5_list = [] # default_bt5_list = []
if self.parameter_dict.get("flavour", "default") == 'configurator': # if self.parameter_dict.get("flavour", "default") == 'configurator':
default_bt5_list = self.options.get("configurator_bt5_list", '').split() # default_bt5_list = self.options.get("configurator_bt5_list", '').split()
#
self.installERP5Site(user, password, zope_access, mysql_conf, # self.installERP5Site(user, password, zope_access, mysql_conf,
conversion_server_conf, memcached_conf, kumo_conf, # conversion_server_conf, memcached_conf, kumo_conf,
self.site_id, default_bt5_list, ca_conf) # self.site_id, default_bt5_list, ca_conf)
self.installTestRunner(ca_conf, mysql_conf, conversion_server_conf, self.installTestRunner(ca_conf, mysql_conf, conversion_server_conf,
memcached_conf, kumo_conf) memcached_conf, kumo_conf)
......
...@@ -24,21 +24,11 @@ ...@@ -24,21 +24,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os
import urlparse import urlparse
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericSlapRecipe
class Recipe(GenericBaseRecipe): class Recipe(GenericSlapRecipe):
def install(self): def _install(self):
# def installERP5Site(self, user, password, zope_access, mysql_conf,
# conversion_server_conf=None, memcached_conf=None,
# kumo_conf=None,
# erp5_site_id='erp5', default_bt5_list=[], ca_conf={},
# supervisor_controlled=True):
# """
# Create a script to automatically set up an erp5 site (controlled by
# supervisor by default) on available zope and mysql environments.
# """
conversion_server = None conversion_server = None
if 'cloudooo-url' in self.options and self.options['cloudooo-url']: if 'cloudooo-url' in self.options and self.options['cloudooo-url']:
parsed = urlparse.urlparse(self.options['cloudooo-url']) parsed = urlparse.urlparse(self.options['cloudooo-url'])
...@@ -53,38 +43,31 @@ class Recipe(GenericBaseRecipe): ...@@ -53,38 +43,31 @@ class Recipe(GenericBaseRecipe):
kumofs = "%s:%s" % (parsed.hostname, parsed.port) kumofs = "%s:%s" % (parsed.hostname, parsed.port)
parsed = urlparse.urlparse(self.options['mysql-url']) parsed = urlparse.urlparse(self.options['mysql-url'])
mysql_connection_string = "%(database)s %(hostname)s@%(port)s %(username)s %(password)s" % dict( mysql_connection_string = "%(database)s %(hostname)s@%(port)s "\
"%(username)s %(password)s" % dict(
database=parsed.path.split('/')[1], database=parsed.path.split('/')[1],
hostname=parsed.hostname, hostname=parsed.hostname,
port=parsed.port, port=parsed.port,
username=parsed.username, username=parsed.username,
password=parsed.password password=parsed.password
) )
raise NotImplementedError
bt5_list = self.parameter_dict.get("bt5_list", "").split() or default_bt5_list
bt5_repository_list = self.parameter_dict.get("bt5_repository_list", "").split() \
or getattr(self, 'bt5_repository_list', [])
erp5_update_directory = supervisor_controlled and self.wrapper_directory or \
self.bin_directory
script = zc.buildout.easy_install.scripts([('erp5_update',
__name__ + '.erp5', 'updateERP5')], self.ws,
sys.executable, erp5_update_directory,
arguments=[erp5_site_id,
mysql_connection_string,
[user, password, zope_access],
memcached,
conversion_server,
kumofs,
bt5_list,
bt5_repository_list,
ca_conf.get('certificate_authority_path'),
self.options.get('openssl_binary')])
self.path_list.extend(script)
return []
parsed = urlparse.urlparse(self.options['url'])
zope_user = parsed.username
zope_password = parsed.password
zope_host = '%s:%s' % (parsed.hostname, parsed.port)
bt5_list = []
if len(self.parameter_dict.get("bt5_list", "").strip()):
bt5_list = self.parameter_dict["bt5_list"].split()
elif self.parameter_dict.get("flavour", "default") == 'configurator':
bt5_list = self.options['configurator-bt5-list'].split()
bt5_repository_list = self.parameter_dict.get("bt5_repository_list",
"").split() or self.options['bt5-repository-list'].split()
script = self.createPythonScript(self.options['update-wrapper'],
__name__+'.erp5.updateERP5', [
self.options['site-id'], mysql_connection_string,
[zope_user, zope_password, zope_host],
memcached, conversion_server, kumofs, bt5_list, bt5_repository_list,
self.options['cadir-path'], self.options['openssl-binary']])
return [script]
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