Merge changes from topics 'add_config', 'fix_doc'
authorzhang ab <zhanganbing@chinamobile.com>
Tue, 27 Mar 2018 02:29:53 +0000 (02:29 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 27 Mar 2018 02:29:53 +0000 (02:29 +0000)
* changes:
  Add port of api server as configuration
  Hack the python path

multivimbroker/multivimbroker/api_v2/service.py
multivimbroker/multivimbroker/pub/config/config.py
multivimbroker/multivimbroker/scripts/api.py

index 228cc63..d080068 100644 (file)
@@ -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
         )
 
index f814528..e0385e2 100644 (file)
@@ -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
index 01b69a2..b9526d7 100644 (file)
 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