Skip to content

Commit e9d3a7b

Browse files
committed
test: Ignore 'OS_' environment variables
Our functional tests are inherently dependent on 'clouds.yaml' files. The presence of 'OS_*' environment variables can cause weird test failures. Simply don't pass them through to our test environment. Change-Id: I7d24cdff5f1f5798118816b12d7398b87a5f5ed4 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 900fad5 commit e9d3a7b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • openstackclient/tests/functional

openstackclient/tests/functional/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ def execute(cmd, *, fail_ok=False):
3030
cmdlist = shlex.split(cmd)
3131
stdout = subprocess.PIPE
3232
stderr = subprocess.PIPE
33+
env = {
34+
k: v for k, v in os.environ.copy().items() if not k.startswith('OS_')
35+
}
3336

34-
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr)
37+
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr, env=env)
3538

3639
result_out, result_err = proc.communicate()
3740
result_out = result_out.decode('utf-8')

0 commit comments

Comments
 (0)