pbs: autogen encryption key: bubble up error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-11-12 11:49:01 +01:00
parent 8ff8e27713
commit 4558cb6eb6

View File

@ -363,7 +363,9 @@ sub prune_backups {
my $autogen_encryption_key = sub {
my ($scfg, $storeid) = @_;
my $encfile = pbs_encryption_key_file_name($scfg, $storeid);
run_command(['proxmox-backup-client', 'key', 'create', '--kdf', 'none', $encfile]);
my $cmd = ['proxmox-backup-client', 'key', 'create', '--kdf', 'none', $encfile];
run_command($cmd, errmsg => 'failed to create encryption key');
return PVE::Tools::file_get_contents($encfile);
};
sub on_add_hook {