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
changes/61/36861/2
Guillem Jover 7 years ago
parent 98b31bf169
commit 5c1e24ea16

@ -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;
-%]
-%]

Loading…
Cancel
Save