pbs: check if encryption key could be deleted

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-07-24 19:06:01 +02:00
parent 18cf6c9f27
commit 4ef17e1fe0

View File

@ -113,7 +113,10 @@ sub pbs_delete_encryption_key {
my $pwfile = pbs_encryption_key_file_name($scfg, $storeid);
unlink $pwfile;
if (!unlink $pwfile) {
return if $! == ENOENT;
die "failed to delete encryption key! $!\n";
}
delete $scfg->{'encryption-key'};
}