Merge "Remove invalid test methods for config option port_range"

This commit is contained in:
Jenkins
2016-07-09 03:58:21 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 19 deletions

View File

@@ -67,14 +67,13 @@ def release_port(host, port):
def _get_port_range():
config_range = CONF.serial_console.port_range
try:
start, stop = map(int, config_range.split(':'))
if start >= stop:
raise ValueError
except ValueError:
start, stop = map(int, config_range.split(':'))
if start >= stop:
default_port_range = nova.conf.serial_console.DEFAULT_PORT_RANGE
LOG.warning(_LW("serial_console.port_range should be <num>:<num>. "
"Given value %(port_range)s could not be parsed. "
LOG.warning(_LW("serial_console.port_range should be in the "
"format <start>:<stop> and start < stop, "
"Given value %(port_range)s is invalid. "
"Taking the default port range %(default)s."),
{'port_range': config_range,
'default': default_port_range})