diff options
author | Anthony Young <sleepsonthefloor@gmail.com> | 2011-02-16 16:20:53 +0000 |
---|---|---|
committer | Tarmac <> | 2011-02-16 16:20:53 +0000 |
commit | 61963f00ad70e73a06ffb35f3fd4b08696e39502 (patch) | |
tree | 5081fe8dd81dd75b87c5598cd107cbebd18925d6 | |
parent | 17abf5c23f90f15b557131f71657e70e7b5cdef8 (diff) | |
parent | a7f796c0a3dbccb74ba3fe51e3885c716bc88592 (diff) | |
download | nova-61963f00ad70e73a06ffb35f3fd4b08696e39502.tar.gz nova-61963f00ad70e73a06ffb35f3fd4b08696e39502.tar.xz nova-61963f00ad70e73a06ffb35f3fd4b08696e39502.zip |
Fix for bug #716847
If a volume has not yet been assigned to a host, then have "nova-manage volume delete" delete from database and skip the rpc.
-rwxr-xr-x | bin/nova-manage | 7 |
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." |