diff --git a/kuryr/common/config.py b/kuryr/common/config.py index 0d6ca14d..3d8c15ea 100644 --- a/kuryr/common/config.py +++ b/kuryr/common/config.py @@ -46,7 +46,9 @@ core_opts = [ help=_('The default neutron local address-scope name')), cfg.StrOpt('global_default_address_space', default='global_scope', - help=_('The default neutron global address-scope name.')) + help=_('The default neutron global address-scope name.')), + cfg.BoolOpt('debug', default=True, + help=_('Enable or Disable debug mode for kuryr server.')) ] neutron_opts = [ cfg.StrOpt('neutron_uri', diff --git a/kuryr/server.py b/kuryr/server.py index 278853a8..91a05acc 100644 --- a/kuryr/server.py +++ b/kuryr/server.py @@ -21,5 +21,5 @@ def start(): from kuryr import app from kuryr import controllers controllers.check_for_neutron_ext_support() - app.debug = True + app.debug = config.CONF.debug app.run("0.0.0.0", port) diff --git a/kuryr/tests/unit/test_config.py b/kuryr/tests/unit/test_config.py index 8a99b021..04605403 100644 --- a/kuryr/tests/unit/test_config.py +++ b/kuryr/tests/unit/test_config.py @@ -32,6 +32,8 @@ class ConfigurationTest(base.TestKuryrBase): self.assertEqual('http://127.0.0.1:2377', config.CONF.kuryr_uri) + self.assertEqual(True, config.CONF.debug) + self.assertEqual('http://127.0.0.1:9696', config.CONF.neutron_client.neutron_uri)