fix for bug #716847 - if a volume has not been assigned to a host, then delete from db and skip rpc

This commit is contained in:
Anthony Young
2011-02-14 10:43:22 -08:00
parent 4361d50ddb
commit 80ac88366c

View File

@@ -579,6 +579,13 @@ class VolumeCommands(object):
ctxt = context.get_admin_context()
volume = db.volume_get(ctxt, param2id(volume_id))
host = volume['host']
if not host:
print "Volume not yet assigned to host."
print "Deleting volume from database and skipping rpc."
db.volume_destroy(ctxt, param2id(volume_id))
return
if volume['status'] == 'in-use':
print "Volume is in-use."
print "Detach volume from instance and then try again."