]> git.proxmox.com Git - pve-storage.git/commitdiff
pbs: autogen encryption key: bubble up error message
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 12 Nov 2020 10:49:01 +0000 (11:49 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 12 Nov 2020 10:49:01 +0000 (11:49 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/PBSPlugin.pm

index 6403e2e810b6086c28e3a91edd8c672872b133fd..e4c431e2441b2a09ec14ae39b404c38053ecf0fe 100644 (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 {