Skip to content

Commit 5d3ef58

Browse files
committed
borgbackup: force numeric output for JSON values
1 parent 31a62d8 commit 5d3ef58

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

snmp/borgbackup

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ sub finish {
317317
}
318318

319319
my $j = JSON->new;
320+
$j->allow_nonref(1);
320321
if ($pretty) {
321322
$j->pretty(1);
322323
$j->canonical(1);
@@ -608,7 +609,7 @@ foreach my $repo (@repos) {
608609
} else {
609610
if ( defined( $info->{cache} ) && defined( $info->{cache}{stats} ) ) {
610611
for my $stat (@stats) {
611-
$repo_info->{$stat} = $info->{cache}{stats}{$stat};
612+
$repo_info->{$stat} = $info->{cache}{stats}{$stat} + 0;
612613
}
613614
if ($verbose) {
614615
print STDERR " Stats: total_size=" . $repo_info->{total_size} . ", total_csize=" . $repo_info->{total_csize} . "\n";

0 commit comments

Comments
 (0)