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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lisa Casino
slapos
Commits
07e9f166
Commit
07e9f166
authored
Oct 19, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support thread amount.
parent
a0e1be59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
slapos/recipe/generate_erp5_tidstorage.py
slapos/recipe/generate_erp5_tidstorage.py
+19
-6
No files found.
slapos/recipe/generate_erp5_tidstorage.py
View file @
07e9f166
...
...
@@ -47,6 +47,7 @@ class Recipe(GenericSlapRecipe):
# prepare zeo
output
=
''
part_list
=
[]
zope_dict
=
{}
zope_connection_dict
=
{}
snippet_zeo
=
open
(
self
.
options
[
'snippet-zeo'
]).
read
()
for
zeo_id
,
zeo_configuration
in
json_data
[
'zeo'
].
iteritems
():
...
...
@@ -70,24 +71,36 @@ class Recipe(GenericSlapRecipe):
'server'
:
'${zeo-instance-%(zeo-id)s:ip}:${zeo-instance-%(zeo-id)s:port}'
%
{
'zeo-id'
:
zeo_id
}
}
zope_dict
.
update
(
timezone
=
json_data
[
'timezone'
]
)
# always one distribution node
current_zope_port
+=
1
snippet_zope
=
open
(
self
.
options
[
'snippet-zope'
]).
read
()
part_list
.
append
(
'zope-distribution'
)
output
+=
snippet_zope
%
zope_connection_dict
zope_id
=
'zope-distribution'
part_list
.
append
(
zope_id
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
zope_id
,
zope_port
=
current_zope_port
,
**
zope_dict
)
# always one admin node
part_list
.
append
(
'zope-admin'
)
output
+=
snippet_zope
%
zope_connection_dict
current_zope_port
+=
1
zope_id
=
'zope-admin'
part_list
.
append
(
zope_id
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
zope_id
,
zope_port
=
current_zope_port
,
**
zope_dict
)
# handle activity key
for
q
in
range
(
1
,
json_data
[
'activity'
][
'zopecount'
]
+
1
):
current_zope_port
+=
1
part_name
=
'zope-activity-%s'
%
q
part_list
.
append
(
part_name
)
output
+=
snippet_zope
%
zope_connection_dict
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
**
zope_dict
)
# handle backend key
for
backend_type
,
backend_configuration
in
json_data
[
'backend'
].
iteritems
():
for
q
in
range
(
1
,
backend_configuration
[
'zopecount'
]
+
1
):
current_zope_port
+=
1
part_name
=
'zope-%s-%s'
%
(
backend_type
,
q
)
part_list
.
append
(
part_name
)
output
+=
snippet_zope
%
zope_connection_dict
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
backend_configuration
[
'thread-amount'
],
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
**
zope_dict
)
prepend
=
open
(
self
.
options
[
'snippet-master'
]).
read
()
%
dict
(
part_list
=
'
\
n
'
.
join
([
' '
+
q
for
q
in
part_list
]))
output
=
prepend
+
output
...
...
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