summaryrefslogtreecommitdiff
path: root/nova/storage
diff options
context:
space:
mode:
Diffstat (limited to 'nova/storage')
-rw-r--r--nova/storage/linuxscsi.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/nova/storage/linuxscsi.py b/nova/storage/linuxscsi.py
index 95cec192d4..afd8aa81ce 100644
--- a/nova/storage/linuxscsi.py
+++ b/nova/storage/linuxscsi.py
@@ -123,17 +123,19 @@ def find_multipath_device(device):
LOG.debug(_("Found multipath device = %(mdev)s") % locals())
device_lines = lines[3:]
for dev_line in device_lines:
- dev_line = dev_line.strip()
- dev_line = dev_line[3:]
+ if dev_line.find("policy") != -1:
+ continue
+
+ dev_line = dev_line.lstrip(' |-`')
dev_info = dev_line.split()
- if dev_line.find("policy") == -1:
- address = dev_info[0].split(":")
-
- dev = {'device': '/dev/%s' % dev_info[1],
- 'host': address[0], 'channel': address[1],
- 'id': address[2], 'lun': address[3]
- }
- devices.append(dev)
+ address = dev_info[0].split(":")
+
+ dev = {'device': '/dev/%s' % dev_info[1],
+ 'host': address[0], 'channel': address[1],
+ 'id': address[2], 'lun': address[3]
+ }
+
+ devices.append(dev)
if mdev is not None:
info = {"device": mdev,