Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
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
Simone Rossi
main
Commits
e10b7075
Commit
e10b7075
authored
Oct 04, 2016
by
Daniele Venzano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
environment key is optional in app descriptions
parent
6f21b732
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
zoe_master/zapp_to_docker.py
zoe_master/zapp_to_docker.py
+9
-8
No files found.
zoe_master/zapp_to_docker.py
View file @
e10b7075
...
...
@@ -57,14 +57,15 @@ def _gen_environment(service, env_subst_dict, copts):
""" Generate a dictionary containing the current cluster status (before the new container is spawned)
This information is used to substitute template strings in the environment variables."""
for
env_name
,
env_value
in
service
.
description
[
'environment'
]:
try
:
env_value
=
env_value
.
format
(
**
env_subst_dict
)
except
KeyError
:
error_msg
=
"Unknown variable in environment expression '{}', known variables are: {}"
.
format
(
env_value
,
list
(
env_subst_dict
.
keys
()))
service
.
set_error
(
error_msg
)
raise
ZoeStartExecutionFatalException
(
"Service {} has wrong environment expression"
)
copts
.
add_env_variable
(
env_name
,
env_value
)
if
'environment'
in
service
.
description
:
for
env_name
,
env_value
in
service
.
description
[
'environment'
]:
try
:
env_value
=
env_value
.
format
(
**
env_subst_dict
)
except
KeyError
:
error_msg
=
"Unknown variable in environment expression '{}', known variables are: {}"
.
format
(
env_value
,
list
(
env_subst_dict
.
keys
()))
service
.
set_error
(
error_msg
)
raise
ZoeStartExecutionFatalException
(
"Service {} has wrong environment expression"
)
copts
.
add_env_variable
(
env_name
,
env_value
)
def
_spawn_service
(
execution
:
Execution
,
service
:
Service
,
env_subst_dict
:
dict
):
...
...
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