1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

Bootstrap: Make sure that _env_root is an absolute path

If the environment variable $WA_USER_DIRECTORY is not set `_env_root`
is automatically generated from the path expansion of `~`. In some cases
if a home directory is not avaliable for the user this may result in an empty
string. This commit ensure that '_env_root' is still an absolute path
using the current working directory.
This commit is contained in:
Marc Bonnici 2017-08-14 17:55:13 +01:00
parent 16b302679a
commit 8dcf1ba6a5

View File

@ -176,6 +176,7 @@ def init_environment(env_root, dep_dir, extension_paths, overwrite_existing=Fals
_env_root = os.getenv('WA_USER_DIRECTORY', os.path.join(_user_home, '.workload_automation'))
_env_root = os.path.abspath(_env_root)
_dep_dir = os.path.join(_env_root, 'dependencies')
_extension_paths = [os.path.join(_env_root, ext.default_path) for ext in _extensions]
_env_var_paths = os.getenv('WA_EXTENSION_PATHS', '')