global-functions: merge $LogAnd{Error,Put} to $LogPrintExit ...

... and fix logging.

Logging with severity from variable (:log $severity ...) is not
possible, this is considered a syntax error. Also the 'workaround' with
parsing code failed with missing message in log.

The reliable code is a lot longer, so merge the two functions to save a
lot of duplicate code.
This commit is contained in:
Christian Hesse 2020-02-26 14:19:54 +01:00
parent 6036edb506
commit ceaa83b83e
13 changed files with 56 additions and 56 deletions

View file

@ -7,10 +7,10 @@
:local PdPrefix $"pd-prefix";
:global ParseKeyValueStore;
:global LogAndError;
:global LogPrintExit;
:if ([ :typeof $PdPrefix ] = "nothing") do={
$LogAndError error "This script is supposed to run from ipv6 dhcp-client.";
$LogPrintExit error "This script is supposed to run from ipv6 dhcp-client." true;
}
:local Pool [ / ipv6 pool get [ find where prefix=$PdPrefix ] name ];