Skip to content

Commit ac2bd42

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "test: Ignore 'OS_' environment variables"
2 parents b458e78 + e9d3a7b commit ac2bd42

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)