diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-09-05 11:45:45 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-09-05 11:45:45 +0800 |
commit | b4500c26170b024b1c7b7a8211aaab4baa0044d3 (patch) | |
tree | c0c8129af3012307ab0c4ed931c85007c10d5ffa | |
parent | dd14603bfe9fb57d1e26208c093e87de8f42dc61 (diff) |
bugfix: container start failed due to config_file set to Nonetype
Traceback (most recent call last):
File "/usr/local/bin/opnfv-testapi", line 6, in <module>
from opnfv_testapi.cmd.server import main
File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/cmd/server.py", line 34, in <module>
from opnfv_testapi.common.config import CONF
File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 67, in <module>
CONF = Config()
File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 21, in __init__
self._parse()
File "/usr/local/lib/python2.7/dist-packages/opnfv_testapi/common/config.py", line 29, in _parse
if not os.path.exists(self.config_file):
File "/usr/lib/python2.7/genericpath.py", line 18, in exists
os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
Change-Id: Ifa26b5b52e7f1c19a773b02ecc1c45b59b5dc09b
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
-rw-r--r-- | testapi/opnfv_testapi/common/config.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testapi/opnfv_testapi/common/config.py b/testapi/opnfv_testapi/common/config.py index ecfffd8..03515ad 100644 --- a/testapi/opnfv_testapi/common/config.py +++ b/testapi/opnfv_testapi/common/config.py @@ -60,7 +60,7 @@ class Config(object): parser.add_argument("-c", "--config-file", dest='config_file', help="Config file location", metavar="FILE") args, _ = parser.parse_known_args(sys.argv) - if hasattr(args, 'config_file'): + if hasattr(args, 'config_file') and args.config_file: self.config_file = args.config_file |