summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-02-23 13:13:46 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-02-24 22:20:54 +0900
commita1343625267cd87dd72788c25d9ce315aa92947d (patch)
tree126852bedde80af1692343791feb97511490757b
parent7baa456696e7f841926b3188a74fe5211cee8828 (diff)
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>
-rw-r--r--ryu/app/wsgi.py10
1 files 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]+'