Merge branch 'master' into og-api-tokens-simple

This commit is contained in:
Oliver Gorwits
2019-03-21 16:18:58 +00:00
5 changed files with 20 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ use strict;
use warnings;
use 5.010_000;
our $VERSION = '2.042002';
our $VERSION = '2.042003';
use App::Netdisco::Configuration;
=head1 NAME

View File

@@ -34,7 +34,13 @@ config changes over time. Returns a list which can replace C<device_auth>.
=cut
sub fixup_device_auth {
my $config = (setting('device_auth') || setting('snmp_auth'));
my $da = dclone (setting('device_auth') || []);
my $sa = dclone (setting('snmp_auth') || []);
die "error: both snmp_auth and device_auth are defined! use only device_auth.\n"
if scalar @$da and scalar @$sa;
my $config = ((scalar @$da) ? $da : $sa);
my @new_stanzas = ();
# new style snmp config