diff options
-rw-r--r-- | multivimbroker/multivimbroker/api_v2/service.py | 4 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/pub/config/config.py | 3 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/scripts/api.py | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/multivimbroker/multivimbroker/api_v2/service.py b/multivimbroker/multivimbroker/api_v2/service.py index 228cc63..d080068 100644 --- a/multivimbroker/multivimbroker/api_v2/service.py +++ b/multivimbroker/multivimbroker/api_v2/service.py @@ -16,6 +16,7 @@ from oslo_service import service from oslo_service import wsgi from multivimbroker.api_v2 import app +from multivimbroker.pub.config import config as mc_cfg CONF = cfg.CONF @@ -33,9 +34,8 @@ class WSGIService(service.ServiceBase): CONF, "multivimbroker", self.app, - # TODO(xiaohhui): these should be configurable. host="0.0.0.0", - port="9002", + port=mc_cfg.API_SERVER_PORT, use_ssl=False ) diff --git a/multivimbroker/multivimbroker/pub/config/config.py b/multivimbroker/multivimbroker/pub/config/config.py index f814528..e0385e2 100644 --- a/multivimbroker/multivimbroker/pub/config/config.py +++ b/multivimbroker/multivimbroker/pub/config/config.py @@ -36,3 +36,6 @@ FORWARDED_FOR_FIELDS = ["HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_HOST", # [IMAGE LOCAL PATH] ROOT_PATH = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +# [Local Config] +API_SERVER_PORT = 9001 diff --git a/multivimbroker/multivimbroker/scripts/api.py b/multivimbroker/multivimbroker/scripts/api.py index 01b69a2..b9526d7 100644 --- a/multivimbroker/multivimbroker/scripts/api.py +++ b/multivimbroker/multivimbroker/scripts/api.py @@ -12,9 +12,13 @@ import eventlet eventlet.monkey_patch() +import os # noqa from oslo_config import cfg # noqa from oslo_service import service # noqa import sys # noqa +# FIXME: Since there is no explicitly setup process for the project. Hack the +# python here. +sys.path.append(os.path.abspath('.')) from multivimbroker.api_v2 import service as api_service # noqa |