From 79159f80a9c0fec65637d498079e1b8958df8fb7 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Fri, 27 Jul 2018 15:00:37 +0900 Subject: [PATCH] Fix to enable `--config-file` option This commit sets the `--config-file` path to the environment variables `TEMPEST_CONFIG_DIR` and `TEMPEST_CONFIG` to enable the option as a workaround. The `path` is passed to `set_config_path()` however, the running test process is a child process which is a different instance. Change-Id: I8a65ee0f82e41f9659b3f40e2685c0ee0f290342 Related-Bug: #1783751 --- tempest/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tempest/config.py b/tempest/config.py index cc0ba34d09..0834485d6d 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -1217,6 +1217,11 @@ class TempestConfigProxy(object): def set_config_path(self, path): self._path = path + # FIXME(masayukig): bug#1783751 To pass the config file path to child + # processes, we need to set the environment variables here as a + # workaround. + os.environ['TEMPEST_CONFIG_DIR'] = os.path.dirname(path) + os.environ['TEMPEST_CONFIG'] = os.path.basename(path) CONF = TempestConfigProxy()