From: John Griffith Date: Tue, 18 Jun 2013 22:49:13 +0000 (-0600) Subject: Update attach status when instance id invalid. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4aaa3b64a3ca3050ebed3d748d46facafc09413b;p=openstack-build%2Fcinder-build.git Update attach status when instance id invalid. In cinder.manager do_attach we have a check to make sure the supplied instance id is a valid UUID which is great, but if it's not we just raise and dump out, leaving the volume in an attaching state. We should update the status to error_attaching in this case and then raise/return. Fixes bug: 1192370 Change-Id: Ia759ea7a387544913953ca84e9ed927480c4edfd --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 4f4b3d8ad..c352f1bca 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -570,9 +570,10 @@ class VolumeManager(manager.SchedulerDependentManager): {"instance_uuid": instance_uuid, "status": "attaching"}) - # TODO(vish): refactor this into a more general "reserve" - # TODO(sleepsonthefloor): Is this 'elevated' appropriate? if not uuidutils.is_uuid_like(instance_uuid): + self.db.volume_update(context, + volume_id, + {'status': 'error_attaching'}) raise exception.InvalidUUID(uuid=instance_uuid) try: