From a1343625267cd87dd72788c25d9ce315aa92947d Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Thu, 23 Feb 2017 13:13:46 +0900 Subject: 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 Signed-off-by: FUJITA Tomonori --- ryu/app/wsgi.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ryu/app/wsgi.py b/ryu/app/wsgi.py index fc4c71ac..0b98df94 100644 --- a/ryu/app/wsgi.py +++ b/ryu/app/wsgi.py @@ -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]+' -- cgit v1.2.3