btrbk: handle errors from btrfs filesystem usage

Fix `btrbk usage` unhandled error case if usage data cannot be
retrieved, e.g.:

   ERROR: Failed to fetch btrfs filesystem usage for: example.com:/mnt/btr_pool
   ERROR: ... sh: ssh -i 'XXX' btrbk@example.com 'btrfs-filesystem-usage '\''/mnt/btr_pool'\'''
   ERROR: ... cannot access '/mnt/btr_pool': Permission denied
pull/459/head
Axel Burri 2022-02-22 20:28:01 +01:00
parent 0388cf4b2d
commit 31ce14e4c2
1 changed files with 1 additions and 1 deletions

2
btrbk
View File

@ -6439,7 +6439,7 @@ MAIN:
return unless($mountpoint);
my $mount_source = $mountpoint->{mount_source};
my $mid = $vol->{MACHINE_ID} . $mount_source;
$usage_cache{$mid} //= btrfs_filesystem_usage($vol);
$usage_cache{$mid} //= btrfs_filesystem_usage($vol) // {};
push @data, { %{$usage_cache{$mid}},
type => $type,
mount_source => $mount_source,