* Completely manage LI admins by editing
www_admin->lawful_intercept_admins in config.yml
* Executing ngcpcfg apply will now add new admins
found in config.yml, update their email if it is
changed in config.yml, and delete them from DB
if they're not found in config.yml
Change-Id: Iae5874fe77443469354e4446b83a68b178e4730c
We are using console_output() from within log_info(), which is invoking
`console_output "$*\n"`, so we need to expand the escape sequences
(without interpreting other format specifiers), which is exactly what
"%b" provides in bash.
This is a fixup for previous commit 0dda93ad97
Change-Id: I16f354eb35e13568331e5107aff0d1c80dafb822
shellcheck v0.7.1 complains about a bunch of issues:
SC1083: This { is literal. Check expression (missing ;/\n?) or quote it.
SC1083: This } is literal. Check expression (missing ;/\n?) or quote it.
SC1090: Can't follow non-constant source. Use a directive to specify location.
SC2034: foo appears unused. Verify it or export it.
SC2059: Don't use variables in the printf format string. Use printf '..%s..' "$foo".
SC2128: Expanding an array without an index only gives the first element.
SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
SC2155: Declare and assign separately to avoid masking return values.
SC2162: read without -r will mangle backslashes.
SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
SC2237: Use [ -z .. ] instead of ! [ -n .. ].
We're still bound to support shellcheck v0.3.4 and sadly this version
fails hard when using the modern "shellcheck source=" directives to
address SC1090 and SC1091. It's failing like:
| not ok 1 source/functions/init:8:28: note: The mentioned parser error was in this then clause. [SC1009]
| not ok 2 source/functions/init:10:3: error: Couldn't parse this shellcheck annotation. [SC1073]
| not ok 3 source/functions/init:10:16: error: Unexpected "s". Fix any mentioned problems and try again. [SC1072]
So until we can get rid of supporting this ancient shellcheck version,
instead of using:
| # shellcheck source=etc/ngcp-config/ngcpcfg.cfg
| # shellcheck source=functions/init
| # shellcheck source=functions/logs
| # shellcheck source=functions/main
we need to place disable=SC1090 and disable=SC1091 accordingly.
Change-Id: I14da87a00102609bffdb60e932045180c6d13d5e
While at it, provide README file for better visibility
at https://github.com/sipwise/ngcpcfg, now also providing
build status information.
Change-Id: Ia25dd9577205336abfb9169e259f3f2cbdb76b35
This makes it possible to use more specific config.yml files either for
a pair of nodes, for settings that will always affect both, or for the
HA names, for settings that might affect all A or B nodes.
This matches the support in the template files.
We need to move sourcing the ha_features and carrier_features before
sourcing init, as now the ngcpcfg.cfg file can use these variables if
set.
Change-Id: Ic6b32acceb8f020f48c3afa09d9e84252b3531e7
Add a new config flag to interfaces to allow usage with just a shared IP
address configured, without a static IP address. This requires special
routing to be set up by the operator and can be used on dummy interfaces
as well.
We explicitly disallow this usage for any interface that has a type of
ha_int or ssh_* or mon_*.
Change-Id: Id950a525d2f499fdd17a0a9fee876f01e9f01d87
Some of our code relies on general.ngcp_type being present and valid.
But future changes will make this explicitly fail the test suite, so
we prepare it for that.
Repurpose the currently unused LOCAL_CONFIG file to hold NGCP type
specific constant settings.
Change-Id: I7292c7039b720259f89acc2fe9be7bec028ca752
These are redundant and bogus aliases for get_mgmt_node, which were
reading from a generated templated file instead of getting the
information from the source. Keep the alias around for now in case a
customer is still using this function.
Change-Id: I5aec69313d97bef5bbc655d18f03e7c9af0dbc21
recently added *_concurrent_calls_* fields are not
understood otherwise.
was supposed to be case-insensitive ever since, as
also mariadb ignores case of colnames.
the only exception is "HEADER=<header name>" tag names,
where <header name> is case-sensitive on purpose.
Change-Id: I5e8cd63657e76348150280621df51edc1b0c867d
Two parallel ngcpcfg processes corrupts this file as they try to write
into it simultaneously.
As a solution use temporary file to prepare the content of ngcpcfg_perms
file and then move it to /etc/ngcp-config/.ngcpcfg_perms.
Change-Id: I74baf3ac78a80d96a1b9dfba2be063b7128b1150
We should not be scanning the entire out list on each iteration, but
just once at the end to remove any duplicate entries.
Change-Id: Ie6524b5f660e1bd62fc73e2808bc6634bdba2dca
Add an entry for PRO, and add output for all IPs. This also covers the
deduplicatioin of IPs, as on PRO and CARRIER, there is a lo interface
per node that has the same 127.0.0.1 address.
Change-Id: I1af28dcf7f9ca99ad169b2f49b4cd6f74858dcfe
On a systemd system, logger does not have enough permissions to send
syslog messages, and command prints this on stderr, which makes some
tests fail. On systems were we can log, this will unnecessarily clutter
the system logs for no good reason.
Change-Id: I0e6fa82794440c79faafad51e3f4ef1bd54394a2
Use an absolute path so that the shell can properly resolve the
pathnames, otherwise they do not get resolved correctly at all.
Change-Id: I03c5db4a831ab44f9eb554fe3638c15bf4708774
The out variable holds a list of hash references, so the grep cannot
work here. Instead track the ips in a separate hash to track whether
they are unique.
Change-Id: I46b26eb25887de08a91f95d24080e1c06b6d3ff7
The host hash contains interfaces and other keys, but one of these keys
contains a list of the interfaces, so we just need to check whether the
interface exists in the hash, instead of scanning all the keys in the
hash and matching the one that is equal to the one we are looking for
which is rather inefficient.
Change-Id: If7d49f0a0680b82cd35ffb3007666d19741372c4
There were functional tests for the get and values actions, but had
never been hooked into any testing framework. And some obsolete build
action tests already covered by the python tests.
Rewrite the get tests in python so that they get executed within docker
with the expected permissions, and remove the old unhooked tests that
are just confusing when adding new functionality.
Change-Id: I7570e35428c1fa0a0f26de75721f84365d4daf9a
When operating on pairs of arguments we also need to return an array
ref.
Change-Id: Ib5ef81f11ecc6473ba6c3ee4b9012884a40e659a
Fixes: commit 59d95f0549
This makes the code easier to understand as it separates generic logic
from one specific to the tt2 processing.
Change-Id: I3b8a9922816e8b15cfba296b4ee4597baeeeffdf
Move the hook selection at the input/output file generation stage, and
refactor the hook execution into a new function.
Change-Id: I010e50d198f946f5e8e5da0e60cf87d5688c45c7
This avoids lots of chmod calls.
We do not need the symlink handling, as we will generate now the files
with the correct permissions, and will respect the symlinks on mv, as
before, and are not doing the explicit chmod anymore.
Change-Id: I9ab75dda79e8b346eb1f41c36b450d6fabb10f11
This is needed for the get command, so that we can exactly control where
to output to, and avoid all the file generation heuristics based on the
input files.
Change-Id: Iace05d1093342722553ec0bbb8ff0e817f77857c
This makes sure we sort each array, instead of sorting the second, and
then letting perl merge the first aray with the result of the second
sort, and then sorting them all as a single array.
Change-Id: I7cd22bf479fee79c104627bf652f0ee674117eec
Fixes: commit 011ce33f32
The current shell code is very inefficient, as it uses files to track
the file lists, and grep to traverse them NxM times per N files.
Change-Id: I8396b4ee232157cea8ef599cba0618be3dd93536
As we now run the processing in parallel, we should not take CPU time
from other more important tasks in the system.
Change-Id: Ifcfdbc6838a377c00025b4ddb30d4ccfbd1dc548
Switch away from the old daemon/wrapper architecture, which complicates
things and requires more scaffolding code.
We turn the daemon/wrapper and build_config into a single perl process
that will load all YAML files, and then process each input/output pair
on a parallel child, to try to speed up the processing as much as
possible.
For whole rebuilds, it might speed up the generation by at least a
factor of x2, x4 or more, depending on the number of active processors.
Change-Id: I51aa2f90336e34a20983d8733f45b64d9b6fea0b
"Utils" TT plugin, to be extended.
provides base64 encoding for now, used by
provisioningtemplates feature.
Change-Id: I2980b57e5dae3d2595ba7017efcdc7e0bd00e469
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