retspen/webvirtmgr — pull request #217 by EmbeddedAndroid (2014-01-30 17:40:33+00:00)
Title: better error handling when locating storage devices

instance/views.py:

when using network storage devices, such as rbd, conn.get_disk_device() generates a libvirtError exception as there is no local path for the device. the issue here is that once this exception is generated, any functions after conn.get_disk_device() never will be called, resulting in data fields not being populated.

for example:

a graceful error is displayed, however the network, media, vcpu, memory, xml, etc.. data fields are never populated, as the functions were never called due to the exception.
https://docs.google.com/file/d/0B9DbsE2BbZ7uQnc3VU5udEZLTDg/edit
https://docs.google.com/file/d/0B9DbsE2BbZ7ualFhQWtsOWZieHc/edit
https://drive.google.com/file/d/0B9DbsE2BbZ7uX2VoNzlPTHUxdkE/edit

the solution purposed here is the handle theses errors in the get_disk_device, and get_media_device to ensure we populate all data fields.

after the patch is applied:

https://docs.google.com/file/d/0B9DbsE2BbZ7uR2JBZGtLeEUzRDg/edit
https://docs.google.com/file/d/0B9DbsE2BbZ7ucmd6LXFTSDhBLWc/edit
https://docs.google.com/file/d/0B9DbsE2BbZ7uLUlBejBGbFkwOGs/edit?usp=drive_web

Signed-off-by: Tyler Baker