diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-01-20 19:12:53 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-01-20 19:12:53 +0000 |
commit | d1d0ca7b6b65f08154784e34048c6b1d03486133 (patch) | |
tree | 74086c01fbf34b22de4757726e7b94120b2e92c8 /perl-install/lvm.pm | |
parent | fcb34609455e2cc75e19de5d4104b2a1ad0ae85a (diff) | |
download | drakx-d1d0ca7b6b65f08154784e34048c6b1d03486133.tar drakx-d1d0ca7b6b65f08154784e34048c6b1d03486133.tar.gz drakx-d1d0ca7b6b65f08154784e34048c6b1d03486133.tar.bz2 drakx-d1d0ca7b6b65f08154784e34048c6b1d03486133.tar.xz drakx-d1d0ca7b6b65f08154784e34048c6b1d03486133.zip |
(lvm_cmd_or_die) report back error from lvm2
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r-- | perl-install/lvm.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 83d3e7896..6a6c250f9 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -56,7 +56,12 @@ sub lvm_cmd { } sub lvm_cmd_or_die { my ($prog, @para) = @_; - lvm_cmd($prog, @para) or die "$prog failed\n"; + my @err; + lvm_cmd("2>", \@err, $prog, @para) or do { + my $err = $err[-1]; # prevent "Modification of non-creatable array value attempted" + chomp($err); + die "$prog failed: $err\n"; + }; } sub check { |