Commit 1dd50804 authored by Benjamin Blanc's avatar Benjamin Blanc

scalability: Fix missing input in bootstrap section

parent 75733bad
......@@ -107,7 +107,7 @@ class Recipe(GenericBaseRecipe):
elif self.options.get('zope-url'):
zope_port = zope_parsed.port
else:
zope_port = 8080
zope_port = "8080"
# Zope username and password
if self.options.get('zope-username') and self.options.get('zope-password'):
zope_username = self.options['zope-username']
......@@ -133,15 +133,21 @@ class Recipe(GenericBaseRecipe):
else:
zope_site_id = 'erp5'
# Scalability
if self.options.get('scalability'):
scalability = self.options['scalability']
else:
scalability = "False"
config = dict(
python_path=sys.executable,
user=zope_username,
password=zope_password,
site_id=zope_site_id,
host="%s:%s" % (zope_hostname, zope_port),
host="%s:%s" % (zope_hostname, str(zope_port)),
protocol=zope_protocol,
sql_connection_string=mysql_connection_string,
scalability=self.options.get('scalability', 'False'),
scalability=scalability,
)
# Runners
......
......@@ -8,9 +8,11 @@ user = "%(user)s"
password = "%(password)s"
host = "%(host)s"
site_id = "%(site_id)s"
erp5_catalog_storage = 'erp5_mysql_innodb_catalog'
mysql_url = "%(sql_connection_string)s"
protocol = "%(protocol)s"
scalability = True
erp5_catalog_storage = 'erp5_mysql_innodb_catalog'
header_dict = {'Authorization': 'Basic %%s' %% \
base64.encodestring('%%s:%%s' %% (user, password)).strip()}
......@@ -58,12 +60,11 @@ if result.status == 204: # and (result.read() == "False"):
# Scalability: Install and configure small buisiness
is_scalability_case = "%(scalability)s" == "True"
if is_scalability_case:
if scalability:
print "Scalability case"
# Here check if configurator is available
configurator_available = False
cancel_url = "https%3A%2F%2F192.168.241.110%3A2153%2Ferp5%2FERP5Site_viewCheckConsistency"
if not configurator_available:
if is_scalability_case:
import os
......@@ -79,8 +80,7 @@ if is_scalability_case:
urllib.urlencode({
'update_method': 'ERP5Site_updateConfigurationConsistency',
'dialog_id'='ERP5Site_viewCheckConsistency',
# TODO: change ip
'cancel_url'='https%3A%2F%2F192.168.241.110%3A2153%2Ferp5%2FERP5Site_viewCheckConsistency',
'cancel_url'=cancel_url,
'dialog_method'='ERP5Site_fixConfigurationConsistency',
'dialog_category'='None',
'object_path'='%2Ferp5',
......@@ -102,8 +102,8 @@ if is_scalability_case:
'listbox_uid%3Alist'='599',
'Base_callDialogMethod%3Amethod'='',
}),
headers=header_dict
)
headers=header_dict)
print "POST sent"
result = zope_connection.getresponse()
print result.read()
......
......@@ -329,7 +329,7 @@ md5sum = 0b401bb15c1b2b6e346fe667e082b1bc
[template-scalability]
< = download-base
filename = instance-scalability.cfg.in
md5sum = 86562c997e9309f84405ada96c9ffbd5
md5sum = 3395d97450b0e92b0682acef39ca531c
[template-zeo]
< = download-base
......
......@@ -101,6 +101,7 @@ zope-username = zope
zope-password = insecure
zope-site-id = {{ site_id }}
zope-url = ${erp5-cluster:connection-family-scalability}
scalability = True
[erp5-promise]
recipe = slapos.cookbook:erp5.promise
......
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