From 0108a27f942a06caf4f64545efc45cf410593c74 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Sat, 15 Aug 2015 11:11:01 -0700 Subject: [PATCH] Use min and max on IntOpt option types Latest version of oslo.config support the ability to set valid range on IntOpt option values. This path makes use of that feature for a number of options with well known minimum and maximum values. Change-Id: I26c920a2be68deeaa6ba534eb9d92b2960f78328 --- ceilometer/api/__init__.py | 1 + ceilometer/collector.py | 1 + ceilometer/compute/virt/vmware/inspector.py | 1 + 3 files changed, 3 insertions(+) diff --git a/ceilometer/api/__init__.py b/ceilometer/api/__init__.py index a3265747..6f313ea0 100644 --- a/ceilometer/api/__init__.py +++ b/ceilometer/api/__init__.py @@ -19,6 +19,7 @@ from oslo_config import cfg OPTS = [ cfg.IntOpt('port', default=8777, + min=1, max=65535, deprecated_name='metering_api_port', deprecated_group='DEFAULT', help='The port for the ceilometer API server.', diff --git a/ceilometer/collector.py b/ceilometer/collector.py index 4012dbe6..489da810 100644 --- a/ceilometer/collector.py +++ b/ceilometer/collector.py @@ -35,6 +35,7 @@ OPTS = [ 'an empty string to disable.'), cfg.IntOpt('udp_port', default=4952, + min=1, max=65535, help='Port to which the UDP socket is bound.'), cfg.BoolOpt('requeue_sample_on_dispatcher_error', default=False, diff --git a/ceilometer/compute/virt/vmware/inspector.py b/ceilometer/compute/virt/vmware/inspector.py index fb3b83bd..d1599eff 100644 --- a/ceilometer/compute/virt/vmware/inspector.py +++ b/ceilometer/compute/virt/vmware/inspector.py @@ -34,6 +34,7 @@ OPTS = [ help='IP address of the VMware vSphere host.'), cfg.IntOpt('host_port', default=443, + min=1, max=65535, help='Port of the VMware vSphere host.'), cfg.StrOpt('host_username', default='',