From 5c1e24ea16e6364dec251588a622c1882c6203a6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 14 Jan 2020 15:08:15 +0100 Subject: [PATCH] TT#71952 Handle undefined X_f.alias keys in get_cdr_export_fields The alias key is defined as optional in the config.yml schema. This was producing perl warnings in the templates files: ,--- Argument "" isn't numeric in numeric gt (>) at /usr/lib/ngcp-ngcpcfg/get_cdr_export_fields line 45. Argument "" isn't numeric in numeric gt (>) at /usr/lib/ngcp-ngcpcfg/get_cdr_export_fields line 45. Argument "" isn't numeric in numeric gt (>) at /usr/lib/ngcp-ngcpcfg/get_cdr_export_fields line 45. Argument "" isn't numeric in numeric gt (>) at /usr/lib/ngcp-ngcpcfg/get_cdr_export_fields line 45. 2020-01-14 15:02:30 sp1: Generating /etc/ngcp-cdr-exporter/event-exporter.conf: OK `--- Change-Id: I46084fbd25e9c88c8cdddb7511c378ac06135632 --- lib/get_cdr_export_fields | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/get_cdr_export_fields b/lib/get_cdr_export_fields index 7fb7f9d7..c14ff668 100644 --- a/lib/get_cdr_export_fields +++ b/lib/get_cdr_export_fields @@ -202,7 +202,7 @@ END; out.joins = []; FOREACH X_f IN argv.export_joins; - IF X_f.alias.length > 0; + IF X_f.alias && X_f.alias.length > 0; X_table_spec = X_f.table _ ' ' _ X_f.alias; ELSE; X_table_spec = X_f.table; @@ -226,4 +226,4 @@ FOREACH X_f IN argv.export_conditions; out.conditions.push("{ '" _ X_condition_column _ "' => { '" _ X_f.operand _ "' => '" _ X_f.compare_value _ "' } }"); END; --%] \ No newline at end of file +-%]