Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions zaza/openstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
import tempfile


def _set_proxy_vars():
# Set proxy vars if provided so that all code gets to use it.
for key, val in os.environ.items():
if not key.startswith('TEST_') or 'PROXY' not in key:
continue

_key = key.partition('TEST_')[2]
os.environ[_key.lower()] = val


# The temporary directory can't be used when juju's snap is installed in strict
# mode, so zaza-openstack-tests changes the default tmp directory to the
# directory referenced by TEST_TMPDIR otherwise a directory is created under
Expand All @@ -34,4 +44,5 @@ def _set_tmpdir():
tempfile.tempdir = tmpdir


_set_proxy_vars()
_set_tmpdir()
Loading