basic implementation, rancid graph and nodemonitor missing

This commit is contained in:
Oliver Gorwits
2019-06-13 07:02:09 +01:00
parent 039527c26a
commit fed14bd810
6 changed files with 42 additions and 15 deletions

View File

@@ -135,6 +135,20 @@ if ($ENV{NETDISCO_DOMAIN}) {
}
}
# convert domain_suffix from scalar or list to regexp
config->{'domain_suffix'} = [setting('domain_suffix')]
if ref [] ne ref setting('domain_suffix');
if (scalar @{ setting('domain_suffix') }) {
my @suffixes = map { quotemeta } @{ setting('domain_suffix') };
my $buildref = '(?:'. (join '|', @suffixes) .')$';
config->{'domain_suffix'} = qr/$buildref/;
}
else {
config->{'domain_suffix'} = qr//;
}
# support unordered dictionary as if it were a single item list
if (ref {} eq ref setting('device_identity')) {
config->{'device_identity'} = [ setting('device_identity') ];