Merge "Fix hard-code listen ip "0.0.0.0""
This commit is contained in:
commit
9961e9d39a
@ -13,23 +13,22 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from kuryr_libnetwork import app
|
from kuryr_libnetwork import app
|
||||||
from kuryr_libnetwork.common import config
|
from kuryr_libnetwork.common import config
|
||||||
from kuryr_libnetwork import controllers
|
from kuryr_libnetwork import controllers
|
||||||
|
|
||||||
|
|
||||||
config.init(sys.argv[1:])
|
|
||||||
controllers.neutron_client()
|
|
||||||
controllers.check_for_neutron_ext_support()
|
|
||||||
controllers.check_for_neutron_ext_tag()
|
|
||||||
|
|
||||||
log.setup(config.CONF, 'Kuryr')
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
port = int(config.CONF.kuryr_uri.split(':')[-1])
|
config.init(sys.argv[1:])
|
||||||
app.run("0.0.0.0", port)
|
controllers.neutron_client()
|
||||||
|
controllers.check_for_neutron_ext_support()
|
||||||
|
controllers.check_for_neutron_ext_tag()
|
||||||
|
|
||||||
|
log.setup(config.CONF, 'Kuryr')
|
||||||
|
kuryr_uri = parse.urlparse(config.CONF.kuryr_uri)
|
||||||
|
app.run(kuryr_uri.hostname, kuryr_uri.port)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -12,12 +12,14 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from neutronclient.common import exceptions as n_exceptions
|
from neutronclient.common import exceptions as n_exceptions
|
||||||
|
|
||||||
from kuryr.lib import exceptions
|
from kuryr.lib import exceptions
|
||||||
from kuryr_libnetwork.common import config
|
from kuryr_libnetwork.common import config
|
||||||
from kuryr_libnetwork import controllers
|
from kuryr_libnetwork import controllers
|
||||||
|
from kuryr_libnetwork.server import start
|
||||||
from kuryr_libnetwork.tests.unit import base
|
from kuryr_libnetwork.tests.unit import base
|
||||||
|
|
||||||
|
|
||||||
@ -45,6 +47,12 @@ class ConfigurationTest(base.TestKuryrBase):
|
|||||||
self.assertEqual('http://127.0.0.1:35357/v2.0',
|
self.assertEqual('http://127.0.0.1:35357/v2.0',
|
||||||
config.CONF.keystone_client.auth_uri)
|
config.CONF.keystone_client.auth_uri)
|
||||||
|
|
||||||
|
@mock.patch.object(sys, 'argv', return_value='[]')
|
||||||
|
@mock.patch('kuryr_libnetwork.app.run')
|
||||||
|
def test_start(self, mock_run, mock_sys_argv):
|
||||||
|
start()
|
||||||
|
mock_run.assert_called_once_with('127.0.0.1', 23750)
|
||||||
|
|
||||||
def test_check_for_neutron_ext_support_with_ex(self):
|
def test_check_for_neutron_ext_support_with_ex(self):
|
||||||
with mock.patch.object(controllers.app.neutron,
|
with mock.patch.object(controllers.app.neutron,
|
||||||
'show_extension') as mock_extension:
|
'show_extension') as mock_extension:
|
||||||
|
@ -7,7 +7,9 @@ Babel>=2.3.4 # BSD
|
|||||||
Flask!=0.11,<1.0,>=0.10 # BSD
|
Flask!=0.11,<1.0,>=0.10 # BSD
|
||||||
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
||||||
netaddr!=0.7.16,>=0.7.12 # BSD
|
netaddr!=0.7.16,>=0.7.12 # BSD
|
||||||
|
six>=1.9.0 # MIT
|
||||||
oslo.concurrency>=3.8.0 # Apache-2.0
|
oslo.concurrency>=3.8.0 # Apache-2.0
|
||||||
|
oslo.config>=3.14.0 # Apache-2.0
|
||||||
oslo.log>=1.14.0 # Apache-2.0
|
oslo.log>=1.14.0 # Apache-2.0
|
||||||
oslo.serialization>=1.10.0 # Apache-2.0
|
oslo.serialization>=1.10.0 # Apache-2.0
|
||||||
oslo.utils>=3.11.0 # Apache-2.0
|
oslo.utils>=3.11.0 # Apache-2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user