diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-06-18 09:10:19 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-06-19 01:08:39 +0200 |
commit | 997969d3d79bcebf13aeae8763b2c9747df03702 (patch) | |
tree | cbfd658aeac02c58f10049356bd9350a46cb2700 /functest/utils | |
parent | 644d4c54bab9939da3ef2b1655092c7e4981f57d (diff) |
Remove module references __file__
It allows functest to be run directly from a zip file [1].
[1] https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag
Change-Id: I596a71e8cf2bed6dd79655bd5beeb047876a188c
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/utils')
-rw-r--r-- | functest/utils/env.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/functest/utils/env.py b/functest/utils/env.py index 3724ec99..0174588d 100644 --- a/functest/utils/env.py +++ b/functest/utils/env.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import pkg_resources import os import re @@ -16,8 +17,8 @@ default_envs = { 'BUILD_TAG': None, 'OS_ENDPOINT_TYPE': None, 'OS_AUTH_URL': None, - 'CONFIG_FUNCTEST_YAML': os.path.normpath(os.path.join(os.path.dirname( - os.path.abspath(__file__)), '../ci/config_functest.yaml')) + 'CONFIG_FUNCTEST_YAML': pkg_resources.resource_filename( + 'functest', 'ci/config_functest.yaml') } |