diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-02-21 00:32:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-02-21 00:32:59 +0000 |
| commit | 9824ce04dbc3de4581e27c23c6bafe1b78efbf1a (patch) | |
| tree | e5c2a9a8d4de52c4403723fe97fe1f6dde91736d /nova | |
| parent | ce6148cf8f98cedb10bbc2794b5379e1d1e4b75f (diff) | |
| parent | fe5382819a8e21d3c32832d92c41477df21c34fa (diff) | |
Merge "libvirt: fix volume walk of /dev/disk/by-path"
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/libvirt/volume.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/virt/libvirt/volume.py b/nova/virt/libvirt/volume.py index 577cfee2c..1af29fa56 100644 --- a/nova/virt/libvirt/volume.py +++ b/nova/virt/libvirt/volume.py @@ -386,8 +386,11 @@ class LibvirtISCSIVolumeDriver(LibvirtBaseVolumeDriver): return None def _get_iscsi_devices(self): - return [entry for entry in list(os.walk('/dev/disk/by-path'))[0][-1] - if entry.startswith("ip-")] + try: + devices = list(os.walk('/dev/disk/by-path'))[0][-1] + except IndexError: + return [] + return [entry for entry in devices if entry.startswith("ip-")] def _disconnect_mpath(self, iscsi_properties): entries = self._get_iscsi_devices() |
