Skip to content

Commit

Permalink
Handle new LVM output format https://www.virtualmin.com/node/21501
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Mar 10, 2012
1 parent 6466469 commit 279a71d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lvm/lvm-lib.pl
Expand Up @@ -297,12 +297,15 @@ sub list_logical_volumes
open(DISPLAY, "lvdisplay -m 2>/dev/null |");
while(<DISPLAY>) {
s/\r|\n//g;
if (/LV\s+Name\s+(.*\/(\S+))/i) {
$lv = { 'name' => $2,
'device' => $1,
if (/LV\s+(Name|Path)\s+(.*\/(\S+))/i) {
$lv = { 'name' => $3,
'device' => $2,
'number' => scalar(@rv) };
push(@rv, $lv);
}
elsif (/LV\s+Name\s+[^\/]/) {
# Ignore this, as we got the name from LV Path line
}
elsif (/VG\s+Name\s+(.*)/) {
$lv->{'vg'} = $1;
}
Expand Down

0 comments on commit 279a71d

Please sign in to comment.