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
8410e09b
Commit
8410e09b
authored
Aug 30, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5: fix autogeneration of internal NEO cluster name
parent
dc0a41dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
slapos/recipe/publish_early.py
slapos/recipe/publish_early.py
+10
-5
No files found.
slapos/recipe/publish_early.py
View file @
8410e09b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#
#
##############################################################################
##############################################################################
from
collections
import
defaultd
ict
from
collections
import
OrderedD
ict
from
.librecipe
import
unwrap
,
wrap
,
GenericSlapRecipe
from
.librecipe
import
unwrap
,
wrap
,
GenericSlapRecipe
import
six
import
six
...
@@ -66,6 +66,9 @@ class Recipe(GenericSlapRecipe):
...
@@ -66,6 +66,9 @@ class Recipe(GenericSlapRecipe):
the published value 'foo' if it exists. If its __init__ modifies 'x', the new
the published value 'foo' if it exists. If its __init__ modifies 'x', the new
value is published. To prevent [gen-foo] from being accessed too early, 'x'
value is published. To prevent [gen-foo] from being accessed too early, 'x'
is then removed and the value can only be accessed with ${publish-early:foo}.
is then removed and the value can only be accessed with ${publish-early:foo}.
Init sections are processed in the order of first appearance in the '-init'
section, so that a init section can access a value that is generated by a
previous one (above, [gen-bar] can access ${publish-early:foo}).
Generated values don't end up in the buildout installed file, which is good
Generated values don't end up in the buildout installed file, which is good
if they're secret. Note however that buildout won't detect if values change
if they're secret. Note however that buildout won't detect if values change
...
@@ -76,13 +79,16 @@ class Recipe(GenericSlapRecipe):
...
@@ -76,13 +79,16 @@ class Recipe(GenericSlapRecipe):
"""
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
GenericSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
GenericSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
init
=
defaultdict
(
dict
)
init
=
OrderedDict
(
)
for
line
in
options
[
'-init'
].
splitlines
():
for
line
in
options
[
'-init'
].
splitlines
():
if
line
:
if
line
:
k
,
v
=
line
.
split
()
k
,
v
=
line
.
split
()
if
k
not
in
options
:
if
k
not
in
options
:
section
,
v
=
v
.
split
(
':'
)
section
,
v
=
v
.
split
(
':'
)
try
:
init
[
section
][
k
]
=
v
init
[
section
][
k
]
=
v
except
KeyError
:
init
[
section
]
=
{
k
:
v
}
if
init
:
if
init
:
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
cert_file
)
self
.
cert_file
)
...
@@ -123,7 +129,7 @@ class Recipe(GenericSlapRecipe):
...
@@ -123,7 +129,7 @@ class Recipe(GenericSlapRecipe):
new
=
{}
new
=
{}
for
k
,
v
in
six
.
iteritems
(
init
):
for
k
,
v
in
six
.
iteritems
(
init
):
try
:
try
:
publish_dict
[
k
]
=
new
[
v
]
=
init_section
.
pop
(
v
)
options
[
k
]
=
publish_dict
[
k
]
=
new
[
v
]
=
init_section
.
pop
(
v
)
except
KeyError
:
except
KeyError
:
pass
pass
if
new
!=
override
:
if
new
!=
override
:
...
@@ -139,6 +145,5 @@ class Recipe(GenericSlapRecipe):
...
@@ -139,6 +145,5 @@ class Recipe(GenericSlapRecipe):
publish
+=
publish_dict
publish
+=
publish_dict
publish_dict
[
'-publish'
]
=
' '
.
join
(
publish
)
publish_dict
[
'-publish'
]
=
' '
.
join
(
publish
)
volatileOptions
(
options
,
list
(
publish_dict
))
volatileOptions
(
options
,
list
(
publish_dict
))
options
.
update
(
publish_dict
)
install
=
update
=
lambda
self
:
None
install
=
update
=
lambda
self
:
None
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