}
}
+# Create target origins object
+my $targetorigins = {};
+
# Initialise cluster details
while (my($name,$cluster) = each %$clusters)
{
$cluster->{bandwidth_limit} = $cluster->{bandwidth} * 1024 * 1024;
$cluster->{bandwidth_used} = 0;
+
+ $targetorigins->{$cluster->{name}} = {
+ code => $cluster->{name},
+ name => $cluster->{name},
+ lat => $cluster->{lat},
+ lon => $cluster->{lon},
+ bandwidth => 0
+ };
}
my @mappings = ();
# Create JSON collection object
my @json;
-# Create target origins object
-my $targetorigins = {};
-
# Open output files
my $zonefile = IO::File->new("> data/${zone}") || die "$!";
my $jsonfile = IO::File->new("> json/${zone}.json") || die "$!";
}
};
- unless (exists($targetorigins->{$cluster->{name}}))
- {
- $targetorigins->{$cluster->{name}} = {
- code => $cluster->{name},
- name => $cluster->{name},
- lat => $cluster->{lat},
- lon => $cluster->{lon},
- bandwidth => 0
- };
- }
-
$targetorigins->{$cluster->{name}}->{bandwidth} += $origin->{bandwidth};
}