From 0bbdd69070e82b43b26767d993418fa07caeb16c Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Thu, 22 Oct 2015 01:01:32 -0600 Subject: [PATCH] Use oslo_config new type PortOpt for port options The oslo_config library provides new type PortOpt to validate the range of port now. Change-Id: Ic66ad775a857f89e540b94c48be2761ee82baf79 ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114 Depends-On: Ida294b05a85f5bef587b761fcd03c28c7a3474d8 --- zaqar/transport/websocket/driver.py | 8 ++++---- zaqar/transport/wsgi/driver.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zaqar/transport/websocket/driver.py b/zaqar/transport/websocket/driver.py index 3d76caf6b..6d1e17644 100644 --- a/zaqar/transport/websocket/driver.py +++ b/zaqar/transport/websocket/driver.py @@ -34,11 +34,11 @@ _WS_OPTIONS = ( cfg.StrOpt('bind', default='127.0.0.1', help='Address on which the self-hosting server will listen.'), - cfg.IntOpt('port', default=9000, - help='Port on which the self-hosting server will listen.'), + cfg.PortOpt('port', default=9000, + help='Port on which the self-hosting server will listen.'), - cfg.IntOpt('external-port', default=None, - help='Port on which the service is provided to the user.'), + cfg.PortOpt('external-port', default=None, + help='Port on which the service is provided to the user.'), ) diff --git a/zaqar/transport/wsgi/driver.py b/zaqar/transport/wsgi/driver.py index 74eeb0a6a..33d51edb8 100644 --- a/zaqar/transport/wsgi/driver.py +++ b/zaqar/transport/wsgi/driver.py @@ -36,8 +36,8 @@ _WSGI_OPTIONS = ( cfg.StrOpt('bind', default='127.0.0.1', help='Address on which the self-hosting server will listen.'), - cfg.IntOpt('port', default=8888, - help='Port on which the self-hosting server will listen.'), + cfg.PortOpt('port', default=8888, + help='Port on which the self-hosting server will listen.'), ) _WSGI_GROUP = 'drivers:transport:wsgi'