Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
a4f4fc3a
Commit
a4f4fc3a
authored
Aug 08, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NEO: new recipe to fix/optimize propagation of the 'masters' parameter
parent
ba6c3331
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
setup.py
setup.py
+1
-0
slapos/recipe/neoppod.py
slapos/recipe/neoppod.py
+31
-1
No files found.
setup.py
View file @
a4f4fc3a
...
@@ -134,6 +134,7 @@ setup(name=name,
...
@@ -134,6 +134,7 @@ setup(name=name,
'mydumper = slapos.recipe.mydumper:Recipe'
,
'mydumper = slapos.recipe.mydumper:Recipe'
,
'mysql = slapos.recipe.mysql:Recipe'
,
'mysql = slapos.recipe.mysql:Recipe'
,
'nbdserver = slapos.recipe.nbdserver:Recipe'
,
'nbdserver = slapos.recipe.nbdserver:Recipe'
,
'neoppod.cluster = slapos.recipe.neoppod:Cluster'
,
'neoppod.admin = slapos.recipe.neoppod:Admin'
,
'neoppod.admin = slapos.recipe.neoppod:Admin'
,
'neoppod.master = slapos.recipe.neoppod:Master'
,
'neoppod.master = slapos.recipe.neoppod:Master'
,
'neoppod.storage = slapos.recipe.neoppod:Storage'
,
'neoppod.storage = slapos.recipe.neoppod:Storage'
,
...
...
slapos/recipe/neoppod.py
View file @
a4f4fc3a
...
@@ -26,8 +26,38 @@
...
@@ -26,8 +26,38 @@
##############################################################################
##############################################################################
import
os
import
os
import
shlex
import
shlex
from
slapos.recipe.librecipe
import
GenericBaseRecipe
from
zc.buildout
import
UserError
from
zc.buildout
import
UserError
from
.librecipe
import
GenericBaseRecipe
class
Cluster
(
object
):
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
buildout
=
buildout
self
.
options
=
options
def
publish_early
(
self
,
publish_dict
):
masters
=
publish_dict
.
setdefault
(
'masters'
,
''
)
result_dict
=
{
'connection-admin'
:
[],
'connection-master'
:
[],
}
node_list
=
[]
for
node
in
sorted
(
self
.
options
[
'nodes'
].
split
()):
node
=
self
.
buildout
[
node
]
node_list
.
append
(
node
)
for
k
,
v
in
result_dict
.
iteritems
():
x
=
node
[
k
]
if
x
:
v
.
append
(
x
)
publish_dict
[
'admins'
]
=
' '
.
join
(
result_dict
.
pop
(
'connection-admin'
))
x
=
' '
.
join
(
result_dict
.
pop
(
'connection-master'
))
if
masters
!=
x
:
publish_dict
[
'masters'
]
=
x
for
node
in
node_list
:
node
[
'config-masters'
]
=
x
node
.
recipe
.
__init__
(
self
.
buildout
,
node
.
name
,
node
)
install
=
update
=
lambda
self
:
None
class
NeoBaseRecipe
(
GenericBaseRecipe
):
class
NeoBaseRecipe
(
GenericBaseRecipe
):
...
...
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