vmware-archive / vsphere-flocker-driver

vSphere Flocker driver
Other
24 stars 16 forks source link

Handle case where device.backing.uuid is None #16

Open Leibniz137 opened 8 years ago

Leibniz137 commented 8 years ago

Some of the devices attached to VMs in my vsphere deployment apparently lack a backing uuid (ie. device.backing.uuid is None). This ended up being an issue because this driver checks every VM to see if the device it needs is already attached elsewhere.

During this process an AttributeError was being raised in _list_vsphere_volumes on line 586, specifically where _normalize_uuid was called. This method presumes uuid is a string (and thus has .translate & .lower methods).

This issue manifested itself in vsphere.log with the following error:

2016-02-04 01:36:48,289 - vsphere_blockdevice - ERROR - list_volumes: List volumes failed with error: 'NoneType' object has no attribute 'translate'

Also rm'ed an unused import