tread more carefully when loading device_auth and snmp_auth
This commit is contained in:
@@ -34,7 +34,13 @@ config changes over time. Returns a list which can replace C<device_auth>.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub fixup_device_auth {
|
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 = ();
|
my @new_stanzas = ();
|
||||||
|
|
||||||
# new style snmp config
|
# new style snmp config
|
||||||
|
|||||||
Reference in New Issue
Block a user