From 092a59a65a243bf1c96dbcf61e724c03a424373c Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 12 Mar 2014 17:31:29 -0700 Subject: [PATCH] Use the error_out_volume from flow common instead Instead of a custom piece of logic that errors out a volume due to the driver not initialized issue just use the same one that is used in other flows to accomplish the same update. Change-Id: I2c8f2fbb4d9bb25a19f26cba3dee5e87913d609b --- cinder/volume/flows/manager/manage_existing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cinder/volume/flows/manager/manage_existing.py b/cinder/volume/flows/manager/manage_existing.py index 246a38e4c..5ee2860c4 100644 --- a/cinder/volume/flows/manager/manage_existing.py +++ b/cinder/volume/flows/manager/manage_existing.py @@ -19,6 +19,7 @@ from cinder import exception from cinder import flow_utils from cinder.openstack.common import log as logging from cinder.volume.flows.api import create_volume as create_api +from cinder.volume.flows import common as flow_common from cinder.volume.flows.manager import create_volume as create_mgr LOG = logging.getLogger(__name__) @@ -43,7 +44,10 @@ class PrepareForQuotaReservationTask(flow_utils.CinderTask): driver_name = self.driver.__class__.__name__ LOG.error(_("Unable to manage existing volume. " "Volume driver %s not initialized.") % driver_name) - self.db.volume_update(context, volume_id, dict(status='error')) + flow_common.error_out_volume(context, self.db, volume_id, + reason=_("Volume driver %s " + "not initialized.") % + driver_name) raise exception.DriverNotInitialized() size = self.driver.manage_existing_get_size(volume_ref, -- 2.45.2