Don't prettify JSON output (save bandwidth)

This commit is contained in:
Daniel Berteaud 2013-04-12 19:47:58 +02:00
parent ea9c30ac6c
commit 31896bd441
1 changed files with 3 additions and 3 deletions

View File

@ -17,18 +17,18 @@ my $bpc = BackupPC::Lib->new();
my $hosts = $bpc->HostInfoRead();
my $mainConf = $bpc->ConfigDataRead();
my $data;
my $json;
foreach my $host (keys %$hosts){
my $hostConf = $bpc->ConfigDataRead($host);
my $conf = { %$mainConf, %$hostConf };
my $period = ($conf->{FullPeriod} >= $conf->{IncrPeriod}) ? $conf->{IncrPeriod} : $conf->{FullPeriod};
my $status = ($conf->{BackupsDisable} eq 1) ? 'disabled':'enabled';
push @{$data->{data}},
push @{$json->{data}},
{
"{#BPCHOST}" => $host,
"{#BPCPERIOD}" => $period,
"{#BPCSTATUS}" => $status,
};
}
print to_json($data, {pretty => 1});
print to_json($json);
exit(0);