mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-09 02:38:26 +00:00
supress error messages when removing snapshot
This commit is contained in:
parent
a7e42354de
commit
5bbea954d7
@ -281,15 +281,19 @@ sub cleanup {
|
|||||||
|
|
||||||
if ($task->{cleanup}->{lvm_snapshot}) {
|
if ($task->{cleanup}->{lvm_snapshot}) {
|
||||||
# loop, because we often get 'LV in use: not deactivating'
|
# loop, because we often get 'LV in use: not deactivating'
|
||||||
|
# we use run_command() because we do not want to log errors here
|
||||||
my $wait = 1;
|
my $wait = 1;
|
||||||
while(-b $di->{snapdev}) {
|
while(-b $di->{snapdev}) {
|
||||||
eval { $self->cmd("lvremove -f $di->{snapdev}"); };
|
eval {
|
||||||
|
my $cmd = ['lvremove', '-f', $di->{snapdev}];
|
||||||
|
PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => {});
|
||||||
|
};
|
||||||
last if !$@;
|
last if !$@;
|
||||||
if ($wait >= 64) {
|
if ($wait >= 64) {
|
||||||
$self->logerr($@);
|
$self->logerr($@);
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
$self->loginfo("lvremove failed - trying again in $wait seconds");
|
$self->loginfo("lvremove failed - trying again in $wait seconds") if $wait >= 8;
|
||||||
sleep($wait);
|
sleep($wait);
|
||||||
$wait = $wait*2;
|
$wait = $wait*2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user