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
8410e09b
Commit
8410e09b
authored
5 years ago
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5: fix autogeneration of internal NEO cluster name
parent
dc0a41dc
master
No related merge requests found
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 @@
#
##############################################################################
from
collections
import
defaultd
ict
from
collections
import
OrderedD
ict
from
.librecipe
import
unwrap
,
wrap
,
GenericSlapRecipe
import
six
...
...
@@ -66,6 +66,9 @@ class Recipe(GenericSlapRecipe):
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'
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
if they're secret. Note however that buildout won't detect if values change
...
...
@@ -76,13 +79,16 @@ class Recipe(GenericSlapRecipe):
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
GenericSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
init
=
defaultdict
(
dict
)
init
=
OrderedDict
(
)
for
line
in
options
[
'-init'
].
splitlines
():
if
line
:
k
,
v
=
line
.
split
()
if
k
not
in
options
:
section
,
v
=
v
.
split
(
':'
)
try
:
init
[
section
][
k
]
=
v
except
KeyError
:
init
[
section
]
=
{
k
:
v
}
if
init
:
self
.
slap
.
initializeConnection
(
self
.
server_url
,
self
.
key_file
,
self
.
cert_file
)
...
...
@@ -123,7 +129,7 @@ class Recipe(GenericSlapRecipe):
new
=
{}
for
k
,
v
in
six
.
iteritems
(
init
):
try
:
publish_dict
[
k
]
=
new
[
v
]
=
init_section
.
pop
(
v
)
options
[
k
]
=
publish_dict
[
k
]
=
new
[
v
]
=
init_section
.
pop
(
v
)
except
KeyError
:
pass
if
new
!=
override
:
...
...
@@ -139,6 +145,5 @@ class Recipe(GenericSlapRecipe):
publish
+=
publish_dict
publish_dict
[
'-publish'
]
=
' '
.
join
(
publish
)
volatileOptions
(
options
,
list
(
publish_dict
))
options
.
update
(
publish_dict
)
install
=
update
=
lambda
self
:
None
This diff is collapsed.
Click to expand it.
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