From 13ff1ea8f1aa81274f45cd0480ee5b7649fe03a6 Mon Sep 17 00:00:00 2001 From: MotoKen Date: Mon, 22 Oct 2012 16:32:22 +0800 Subject: Use instance_exists to check existence Use instance_exists instead of list_instances since commit 27c11c4bb4. Change-Id: I780e70f6b573a15e4acc71af16695e0db8ad2581 --- nova/compute/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index c818ff855..51caf6275 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2078,7 +2078,7 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.audit(_('Detach volume %(volume_id)s from mountpoint %(mp)s'), locals(), context=context, instance=instance) - if instance['name'] not in self.driver.list_instances(): + if not self.driver.instance_exists(instance['name']): LOG.warn(_('Detaching volume from unknown instance'), context=context, instance=instance) connection_info = jsonutils.loads(bdm['connection_info']) -- cgit