summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid McNally <dave.mcnally@hp.com>2013-05-23 14:13:10 +0100
committerDavid McNally <dave.mcnally@hp.com>2013-05-28 12:05:56 +0100
commit28b2deac2f9d835cc24d8b5c015762a9780df99b (patch)
treeb187e233b203ceb3241e1c59325ce4ba9fb5073a
parente06ab5877462c83f6574b0304331e3ff906ddb14 (diff)
Removing misleading error message
This function (_get_instances_on_driver) was reporting instances are on the hypervisor and not in the database with no consideration for the filters being used in the database query. This resulted in error log messages indicating running instances were not in the database when in fact the query was filtering for deleted instances. To avoid misleading error logs of this nature I've removed the logging from the function. Currently the locations which call this function provide more accurate logging on the state of the instances that are returned based on the filters they have called _get_instances_on_driver with. bug 1183276 Change-Id: I4ee52fe417f73a90cf157bc531b483be93e34275
-rwxr-xr-xnova/compute/manager.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 74826d8cc..fc8fcc8cc 100755
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -394,8 +394,10 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_uuid=instance_uuid)
def _get_instances_on_driver(self, context, filters=None):
- """Return a list of instance records that match the instances found
- on the hypervisor.
+ """Return a list of instance records for the instances found
+ on the hypervisor which satisfy the specified filters. If filters=None
+ return a list of instance records for all the instances found on the
+ hypervisor.
"""
if not filters:
filters = {}
@@ -404,10 +406,6 @@ class ComputeManager(manager.SchedulerDependentManager):
filters['uuid'] = driver_uuids
local_instances = self.conductor_api.instance_get_all_by_filters(
context, filters, columns_to_join=[])
- local_instance_uuids = [inst['uuid'] for inst in local_instances]
- for uuid in set(driver_uuids) - set(local_instance_uuids):
- LOG.error(_('Instance %(uuid)s found in the hypervisor, but '
- 'not in the database'), locals())
return local_instances
except NotImplementedError:
pass
@@ -422,9 +420,6 @@ class ComputeManager(manager.SchedulerDependentManager):
for driver_instance in driver_instances:
instance = name_map.get(driver_instance)
if not instance:
- LOG.error(_('Instance %(driver_instance)s found in the '
- 'hypervisor, but not in the database'),
- locals())
continue
local_instances.append(instance)
return local_instances