From 67d188cf4a9a61902ab7109b9a80b5b52dfa4d07 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 20 Dec 2012 14:32:13 -0500 Subject: 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 --- nova/api/openstack/compute/contrib/coverage_ext.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nova/api/openstack/compute/contrib/coverage_ext.py b/nova/api/openstack/compute/contrib/coverage_ext.py index 954eddf4c..98a067fc8 100644 --- a/nova/api/openstack/compute/contrib/coverage_ext.py +++ b/nova/api/openstack/compute/contrib/coverage_ext.py @@ -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 -- cgit