diff options
author | Monty Taylor <mordred@inaugust.com> | 2019-11-01 09:18:46 +0900 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2019-11-02 09:10:18 +0900 |
commit | 8014a8286c70ee3bb14c41533400fef43d6ecabd (patch) | |
tree | ed490a3d5193172ef8d1057ef565176554fc8726 /zuul/cmd | |
parent | 1986d263c8bc864ca6d898adcc60a33598535356 (diff) | |
download | zuul-8014a8286c70ee3bb14c41533400fef43d6ecabd.tar.gz |
Revert "Revert "Add the process environment to zuul.conf parser""
Updates the environment variable processing to only affect variables
prefixed with ZUUL_.
Adds a test showing the os.environ with % in it.
This reverts commit b3929b5633188a36be0ac6ede92bfadda9e00eac.
Change-Id: Ic6c3dd0327ef70dc1375486827e4503a4cea9bfc
Diffstat (limited to 'zuul/cmd')
-rwxr-xr-x | zuul/cmd/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py index 0c2204e4f..709c98430 100755 --- a/zuul/cmd/__init__.py +++ b/zuul/cmd/__init__.py @@ -123,7 +123,11 @@ class ZuulApp(object): return parser def readConfig(self): - self.config = configparser.ConfigParser() + safe_env = { + k: v for k, v in os.environ.items() + if k.startswith('ZUUL_') + } + self.config = configparser.ConfigParser(safe_env) if self.args.config: locations = [self.args.config] else: |