Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Alain Takoudjou
slapos.toolbox
Commits
719da31a
Commit
719da31a
authored
Jul 24, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: app parameters are loaded dynamically
and not only when the webrunner starts
parent
49a7b794
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
slapos/runner/__init__.py
slapos/runner/__init__.py
+20
-0
No files found.
slapos/runner/__init__.py
View file @
719da31a
...
...
@@ -4,6 +4,7 @@
import
ConfigParser
import
datetime
import
flask
import
logging
import
logging.handlers
import
os
...
...
@@ -133,4 +134,23 @@ def serve(config):
config
.
logger
.
info
(
'Done.'
)
app
.
wsgi_app
=
ProxyFix
(
app
.
wsgi_app
)
def
getUpdatedParameter
(
self
,
var
):
configuration_parser
=
ConfigParser
.
SafeConfigParser
()
configuration_file_path
=
os
.
path
.
abspath
(
os
.
getenv
(
'RUNNER_CONFIG'
))
configuration_parser
.
read
(
configuration_file_path
)
for
section
in
configuration_parser
.
sections
():
if
configuration_parser
.
has_option
(
section
,
var
):
return
configuration_parser
.
get
(
section
,
var
)
# if the requested var is dependant of flask
if
var
in
self
.
keys
():
temp_dict
=
dict
()
temp_dict
.
update
(
self
)
return
temp_dict
[
var
]
else
:
raise
KeyError
flask
.
config
.
Config
.
__getitem__
=
getUpdatedParameter
run
()
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