summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-04 16:46:30 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-04 16:46:30 +0800
commita69dbc8aa8a838f55629d8c6bd2372268f9dce41 (patch)
tree4f2da7dec7838e83ffe0c8bf85250945d069bd1a /utils/test/testapi
parenta137b9d89ae9e982e5edd33670c040fc4d8603c7 (diff)
improve: discard venv support for official product
virtual env is only to facilitate the development, not be used in official product, thus delete the support, let the developer manage their own development env. Change-Id: I33af882ab257e88b1e7a316d1d78197d6279933d Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi')
-rw-r--r--utils/test/testapi/opnfv_testapi/common/config.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/utils/test/testapi/opnfv_testapi/common/config.py b/utils/test/testapi/opnfv_testapi/common/config.py
index 4cd53c619..ecfffd8dc 100644
--- a/utils/test/testapi/opnfv_testapi/common/config.py
+++ b/utils/test/testapi/opnfv_testapi/common/config.py
@@ -16,7 +16,7 @@ import sys
class Config(object):
def __init__(self):
- self.config_file = None
+ self.config_file = '/etc/opnfv_testapi/config.ini'
self._set_config_file()
self._parse()
self._parse_per_page()
@@ -56,23 +56,12 @@ class Config(object):
return value
def _set_config_file(self):
- if not self._set_sys_config_file():
- self._set_default_config_file()
-
- def _set_sys_config_file(self):
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config-file", dest='config_file',
help="Config file location", metavar="FILE")
args, _ = parser.parse_known_args(sys.argv)
- try:
+ if hasattr(args, 'config_file'):
self.config_file = args.config_file
- finally:
- return self.config_file is not None
-
- def _set_default_config_file(self):
- is_venv = os.getenv('VIRTUAL_ENV')
- self.config_file = os.path.join('/' if not is_venv else is_venv,
- 'etc/opnfv_testapi/config.ini')
CONF = Config()