mirror of
https://opendev.org/openstack/python-openstackclient.git
synced 2026-01-16 23:13:05 +00:00
Merge "test: Ignore 'OS_' environment variables"
This commit is contained in:
commit
ac2bd42372
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