Fix _find_ports() for when backdoor_port is None.

For the case when backdoor_port is None for a service, then the
backdoor_port configuration option was not set for that service.
Instead of failing for this case, just skip establishing a backdoor
connection to services without a backdoor_port, and move on to the
other services.

Change-Id: I0fad967f94b9d9928e9134fe5901d5e256b6ab69
This commit is contained in:
Matthew Treinish
2012-12-20 14:32:13 -05:00
parent 59206947af
commit 67d188cf4a

View File

@@ -80,7 +80,16 @@ class CoverageController(object):
get_port_fn = apicommands[host['service']]
_host = host
_host['port'] = get_port_fn(context, host['host'])
ports.append(_host)
#NOTE(mtreinish): if the port is None then it wasn't set in
# the configuration file for this service. However, that
# doesn't necessarily mean that we don't have backdoor ports
# for all the services. So, skip the telnet connection for
# this service.
if _host['port']:
ports.append(_host)
else:
LOG.warning(_("Can't connect to service: %s, no port"
"specified\n"), host['service'])
else:
LOG.debug(_("No backdoor API command for service: %s\n"), host)
return ports