diff options
author | Christian Heimes <cheimes@redhat.com> | 2016-10-24 10:35:41 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-12-02 15:05:33 +0100 |
commit | d4916254e995be1118ab8dbce5b60091305f97fe (patch) | |
tree | ff6daf4da6512d84c135822ec512aedc5021023f /ipatests/util.py | |
parent | 64a4be26febf19e427760115912a858a804208a0 (diff) | |
download | freeipa-d4916254e995be1118ab8dbce5b60091305f97fe.tar.gz freeipa-d4916254e995be1118ab8dbce5b60091305f97fe.tar.xz freeipa-d4916254e995be1118ab8dbce5b60091305f97fe.zip |
Use env var IPA_CONFDIR to get confdir
The environment variable IPA_CONFDIR overrides the default confdir path.
The value of the environment variable must be an absolute path to an existing
directory. The new variable makes it much simpler to use the 'ipa'
command and ipalib with a local configuration directory.
Some scripts (e.g. servers, installers, and upgrades) set the confdir
explicitly and do not support the env var.
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipatests/util.py')
-rw-r--r-- | ipatests/util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipatests/util.py b/ipatests/util.py index 3f66b595c..7b5e317de 100644 --- a/ipatests/util.py +++ b/ipatests/util.py @@ -96,6 +96,12 @@ class TempDir(object): def __del__(self): self.rmtree() + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.rmtree() + class TempHome(TempDir): def __init__(self): |