summaryrefslogtreecommitdiff
path: root/zuul/cmd
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-11-01 09:18:46 +0900
committerMonty Taylor <mordred@inaugust.com>2019-11-02 09:10:18 +0900
commit8014a8286c70ee3bb14c41533400fef43d6ecabd (patch)
treeed490a3d5193172ef8d1057ef565176554fc8726 /zuul/cmd
parent1986d263c8bc864ca6d898adcc60a33598535356 (diff)
downloadzuul-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-xzuul/cmd/__init__.py6
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: