From: Bill Owen Date: Fri, 27 Sep 2013 18:22:57 +0000 (-0700) Subject: Set vol driver initialized before deleting volumes X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b715701ff4387d55e7eb4c301a0edea92fa4e0e8;p=openstack-build%2Fcinder-build.git 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 --- 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)