mirror of
https://opendev.org/openstack/python-openstackclient.git
synced 2026-01-17 07:20:45 +00:00
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>
This commit is contained in:
parent
900fad5360
commit
e9d3a7bb13
1 changed files with 4 additions and 1 deletions
|
|
@ -30,8 +30,11 @@ def execute(cmd, *, fail_ok=False):
|
|||
cmdlist = shlex.split(cmd)
|
||||
stdout = subprocess.PIPE
|
||||
stderr = subprocess.PIPE
|
||||
env = {
|
||||
k: v for k, v in os.environ.copy().items() if not k.startswith('OS_')
|
||||
}
|
||||
|
||||
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr)
|
||||
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr, env=env)
|
||||
|
||||
result_out, result_err = proc.communicate()
|
||||
result_out = result_out.decode('utf-8')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue