diff --git a/tricircle/api/app.py b/tricircle/api/app.py index 941ae98..597b2a2 100644 --- a/tricircle/api/app.py +++ b/tricircle/api/app.py @@ -22,10 +22,10 @@ from tricircle.common import restapp common_opts = [ - cfg.StrOpt('bind_host', default='0.0.0.0', - help=_("The host IP to bind to")), - cfg.IntOpt('bind_port', default=19999, - help=_("The port to bind to")), + cfg.IPOpt('bind_host', default='0.0.0.0', + help=_("The host IP to bind to")), + cfg.PortOpt('bind_port', default=19999, + help=_("The port to bind to")), cfg.IntOpt('api_workers', default=1, help=_("number of api workers")), cfg.StrOpt('api_extensions_path', default="", diff --git a/tricircle/cinder_apigw/app.py b/tricircle/cinder_apigw/app.py index 2eaf00a..524ee1f 100644 --- a/tricircle/cinder_apigw/app.py +++ b/tricircle/cinder_apigw/app.py @@ -22,10 +22,10 @@ from tricircle.common import restapp common_opts = [ - cfg.StrOpt('bind_host', default='0.0.0.0', - help=_("The host IP to bind to")), - cfg.IntOpt('bind_port', default=19997, - help=_("The port to bind to")), + cfg.IPOpt('bind_host', default='0.0.0.0', + help=_("The host IP to bind to")), + cfg.PortOpt('bind_port', default=19997, + help=_("The port to bind to")), cfg.IntOpt('api_workers', default=1, help=_("number of api workers")), cfg.StrOpt('api_extensions_path', default="", diff --git a/tricircle/nova_apigw/app.py b/tricircle/nova_apigw/app.py index 489f313..9a16994 100644 --- a/tricircle/nova_apigw/app.py +++ b/tricircle/nova_apigw/app.py @@ -22,10 +22,10 @@ from tricircle.nova_apigw.controllers import root common_opts = [ - cfg.StrOpt('bind_host', default='0.0.0.0', - help=_("The host IP to bind to")), - cfg.IntOpt('bind_port', default=19998, - help=_("The port to bind to")), + cfg.IPOpt('bind_host', default='0.0.0.0', + help=_("The host IP to bind to")), + cfg.PortOpt('bind_port', default=19998, + help=_("The port to bind to")), cfg.IntOpt('api_workers', default=1, help=_("number of api workers")), cfg.StrOpt('api_extensions_path', default="", diff --git a/tricircle/tests/base.py b/tricircle/tests/base.py index f9d3bcd..3f692f8 100644 --- a/tricircle/tests/base.py +++ b/tricircle/tests/base.py @@ -18,13 +18,21 @@ from oslo_config import cfg from oslotest import base +CONFLICT_OPT_NAMES = [ + 'api_extensions_path', + 'bind_port', + 'bind_host' +] + + class TestCase(base.BaseTestCase): """Test case base class for all unit tests.""" def setUp(self): - # neutron has configuration options "api_extensions_path" and - # "bind_port" which conflicts with tricircle configuration option, - # so unregister this option before running tricircle tests + # neutron has configuration options "api_extensions_path", + # "bind_port" and "bind_host"which conflicts with tricircle + # configuration option, so unregister this option before + # running tricircle tests for opt in config.core_opts: - if opt.name == 'api_extensions_path' or opt.name == 'bind_port': + if opt.name in CONFLICT_OPT_NAMES: cfg.CONF.unregister_opt(opt) super(TestCase, self).setUp()