Fix backend.NodeVolumes handling of LVM output
authorIustin Pop <iustin@google.com>
Fri, 11 Jul 2008 13:53:50 +0000 (13:53 +0000)
committerIustin Pop <iustin@google.com>
Fri, 11 Jul 2008 13:53:50 +0000 (13:53 +0000)
This is the same fix as for GetVolumeList.

I've checked manually and all other places that call lvm commands are
already checking the output validity in terms of correct number of
fields.

Reviewed-by: ultrotter

lib/backend.py

index eb5d354..b7df899 100644 (file)
@@ -315,7 +315,8 @@ def NodeVolumes():
       'vg': line[3].strip(),
     }
 
-  return [map_line(line.split('|')) for line in result.stdout.splitlines()]
+  return [map_line(line.split('|')) for line in result.stdout.splitlines()
+          if line.count('|') >= 3]
 
 
 def BridgesExist(bridges_list):