MT#12385 Fix using EXPORT_CONDITIONS

On a stock master CE, running edr exporter results in this error:

$ /usr/sbin/event-exporter
Can't use string ("{ accounting.events.export_statu"...) as an ARRAY ref
while "strict refs" in use at /usr/share/perl5/NGCP/CDR/Exporter.pm line 135.

Reason is that EXPORT_CONDITION only has one element in the default config,
and therefore confval() returns a scalar instead of an array ref. Using
get_config_fields() instead always forces an array we can iterate over.

Change-Id: Id6d049b4275a52dc5760a636472082de625d2ac8
changes/44/4344/1
Andreas Granig 11 years ago
parent a49827a122
commit c10d0f9d77

@ -121,7 +121,7 @@ sub get_config {
@reseller_fields = get_config_fields('RESELLER_EXPORT_FIELDS');
@data_fields = get_config_fields('DATA_FIELDS');
foreach my $f(@{confval('EXPORT_JOINS')}) {
foreach my $f(get_config_fields('EXPORT_JOINS')) {
$f =~ s/^\s*\{?\s*//; $f =~ s/\}\s*\}\s*$/}/;
my ($a, $b) = split('\s*=>\s*{\s*', $f);
$a =~ s/^\s*\'//; $a =~ s/\'$//g;
@ -132,7 +132,7 @@ sub get_config {
push @joins, { $a => { $c => $d } };
}
foreach my $f(@{confval('EXPORT_CONDITIONS')}) {
foreach my $f(get_config_fields('EXPORT_CONDITIONS')) {
next unless($f);
$f =~ s/^\s*\{?\s*//; $f =~ s/\}\s*\}\s*$/}/;
my ($a, $b) = split('\s*=>\s*{\s*', $f);

Loading…
Cancel
Save