Skip to content

Commit

Permalink
Update attach status when instance id invalid.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
j-griffith committed Jun 18, 2013
1 parent 3172208 commit 4aaa3b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cinder/volume/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ def do_attach():
{"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:
Expand Down

0 comments on commit 4aaa3b6

Please sign in to comment.