summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-02-14 10:43:22 -0800
committerAnthony Young <sleepsonthefloor@gmail.com>2011-02-14 10:43:22 -0800
commita7f796c0a3dbccb74ba3fe51e3885c716bc88592 (patch)
treef2969c2aa29b3fb366e7b71a0137be0eef00e636
parentef7768154324bbddb56d2c7d7a9d2e354b7d60cf (diff)
downloadnova-a7f796c0a3dbccb74ba3fe51e3885c716bc88592.tar.gz
nova-a7f796c0a3dbccb74ba3fe51e3885c716bc88592.tar.xz
nova-a7f796c0a3dbccb74ba3fe51e3885c716bc88592.zip
fix for bug #716847 - if a volume has not been assigned to a host, then delete from db and skip rpc
-rwxr-xr-xbin/nova-manage7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 7835ca551..e4c0684c4 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -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."