Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos
Commits
91d80971
Commit
91d80971
authored
Oct 19, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fill backend list.
parent
03fc2d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
slapos/recipe/generate_erp5_tidstorage.py
slapos/recipe/generate_erp5_tidstorage.py
+4
-5
stack/erp5.cfg
stack/erp5.cfg
+3
-0
No files found.
slapos/recipe/generate_erp5_tidstorage.py
View file @
91d80971
...
@@ -44,10 +44,6 @@ class Recipe(GenericSlapRecipe):
...
@@ -44,10 +44,6 @@ class Recipe(GenericSlapRecipe):
current_zope_port
=
ZOPE_PORT_BASE
current_zope_port
=
ZOPE_PORT_BASE
current_apache_port
=
APACHE_PORT_BASE
current_apache_port
=
APACHE_PORT_BASE
current_haproxy_port
=
HAPROXY_PORT_BASE
current_haproxy_port
=
HAPROXY_PORT_BASE
num
=
1
for
l
in
self
.
parameter_dict
[
'json'
].
splitlines
():
print
'%3s %s'
%
(
num
,
l
)
num
+=
1
json_data
=
json
.
loads
(
self
.
parameter_dict
[
'json'
])
json_data
=
json
.
loads
(
self
.
parameter_dict
[
'json'
])
site_id
=
str
(
json_data
[
'site-id'
])
site_id
=
str
(
json_data
[
'site-id'
])
# prepare zeo
# prepare zeo
...
@@ -109,11 +105,13 @@ class Recipe(GenericSlapRecipe):
...
@@ -109,11 +105,13 @@ class Recipe(GenericSlapRecipe):
# handle backend key
# handle backend key
snippet_backend
=
open
(
self
.
options
[
'snippet-backend'
]).
read
()
snippet_backend
=
open
(
self
.
options
[
'snippet-backend'
]).
read
()
for
backend_name
,
backend_configuration
in
json_data
[
'backend'
].
iteritems
():
for
backend_name
,
backend_configuration
in
json_data
[
'backend'
].
iteritems
():
haproxy_backend_list
=
[]
for
q
in
range
(
1
,
backend_configuration
[
'zopecount'
]
+
1
):
for
q
in
range
(
1
,
backend_configuration
[
'zopecount'
]
+
1
):
current_zope_port
+=
1
current_zope_port
+=
1
part_name
=
'zope-%s-%s'
%
(
backend_name
,
q
)
part_name
=
'zope-%s-%s'
%
(
backend_name
,
q
)
part_list
.
append
(
part_name
)
part_list
.
append
(
part_name
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
backend_configuration
[
'thread-amount'
],
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
**
zope_dict
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
backend_configuration
[
'thread-amount'
],
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
**
zope_dict
)
haproxy_backend_list
.
append
(
'${%(part_name)s:ip}:${%(part_name)s:port}'
%
dict
(
part_name
=
part_name
))
# now generate backend access
# now generate backend access
current_apache_port
+=
1
current_apache_port
+=
1
current_haproxy_port
+=
1
current_haproxy_port
+=
1
...
@@ -124,7 +122,8 @@ class Recipe(GenericSlapRecipe):
...
@@ -124,7 +122,8 @@ class Recipe(GenericSlapRecipe):
haproxy_port
=
current_haproxy_port
,
haproxy_port
=
current_haproxy_port
,
access_control_string
=
backend_configuration
[
'access-control-string'
],
access_control_string
=
backend_configuration
[
'access-control-string'
],
maxconn
=
backend_configuration
[
'maxconn'
],
maxconn
=
backend_configuration
[
'maxconn'
],
server_check_path
=
'/%s/getId'
%
site_id
server_check_path
=
'/%s/getId'
%
site_id
,
haproxy_backend_list
=
' '
.
join
(
haproxy_backend_list
)
)
)
output
+=
snippet_backend
%
backend_dict
output
+=
snippet_backend
%
backend_dict
prepend
=
open
(
self
.
options
[
'snippet-master'
]).
read
()
%
dict
(
prepend
=
open
(
self
.
options
[
'snippet-master'
]).
read
()
%
dict
(
...
...
stack/erp5.cfg
View file @
91d80971
...
@@ -29,6 +29,9 @@ allow-hosts =
...
@@ -29,6 +29,9 @@ allow-hosts =
www.dabeaz.com
www.dabeaz.com
www.owlfish.com
www.owlfish.com
develop =
/opt/slapdev
extends =
extends =
# Exact version of Zope
# Exact version of Zope
http://svn.zope.org/repos/main/Zope/tags/2.12.20/versions.cfg
http://svn.zope.org/repos/main/Zope/tags/2.12.20/versions.cfg
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment