]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Update attach status when instance id invalid.
authorJohn Griffith <john.griffith@solidfire.com>
Tue, 18 Jun 2013 22:49:13 +0000 (16:49 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Tue, 18 Jun 2013 22:51:30 +0000 (16:51 -0600)
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

cinder/volume/manager.py

index 4f4b3d8ad4e14e1f0f23e208efa37d8d2e5f6aad..c352f1bca914c5dfee12164d7c2575b6450de6fa 100644 (file)
@@ -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: