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