From b715701ff4387d55e7eb4c301a0edea92fa4e0e8 Mon Sep 17 00:00:00 2001 From: Bill Owen Date: Fri, 27 Sep 2013 11:22:57 -0700 Subject: [PATCH] Set vol driver initialized before deleting volumes Move the call to set_initialized before calling delete_volume in init_host. The delete_volume method has a precondition that the driver be initialized. Closes-Bug: #1232177 Change-Id: Ie73bd30e0ab80d489ab61ba8a60fac51ccb505b5 --- cinder/volume/manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 34b4357ab..7716a4854 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -178,6 +178,11 @@ class VolumeManager(manager.SchedulerDependentManager): # to initialize the driver correctly. return + # at this point the driver is considered initailized. + # next re-initialize exports and clean up volumes that + # should be deleted. + self.driver.set_initialized() + volumes = self.db.volume_get_all_by_host(ctxt, self.host) LOG.debug(_("Re-exporting %s volumes"), len(volumes)) for volume in volumes: @@ -197,8 +202,6 @@ class VolumeManager(manager.SchedulerDependentManager): LOG.info(_('Resuming delete on volume: %s') % volume['id']) self.delete_volume(ctxt, volume['id']) - self.driver.set_initialized() - # collect and publish service capabilities self.publish_service_capabilities(ctxt) -- 2.45.2