wsgi: Change default wsgi listen host to "0.0.0.0"

With netaddr.valid_ipv4/6, empty host is not allowed and will fail
to validate.
This patch changes to the default wsgi listen host to "0.0.0.0"
and enable to validate it by using netaddr.

Note: The default behavior is NOT changed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWASE Yusuke 2017-02-23 13:13:46 +09:00 committed by FUJITA Tomonori
parent 7baa456696
commit a134362526

View File

@ -34,11 +34,17 @@ from webob.response import Response as webob_Response
from ryu import cfg
from ryu.lib import hub
DEFAULT_WSGI_HOST = '0.0.0.0'
DEFAULT_WSGI_PORT = 8080
CONF = cfg.CONF
CONF.register_cli_opts([
cfg.StrOpt('wsapi-host', default='', help='webapp listen host'),
cfg.IntOpt('wsapi-port', default=8080, help='webapp listen port')
cfg.StrOpt(
'wsapi-host', default=DEFAULT_WSGI_HOST,
help='webapp listen host (default %s)' % DEFAULT_WSGI_HOST),
cfg.IntOpt(
'wsapi-port', default=DEFAULT_WSGI_PORT,
help='webapp listen port (default %s)' % DEFAULT_WSGI_PORT),
])
HEX_PATTERN = r'0x[0-9a-z]+'