diff --git a/Changes b/Changes index 9c0ddee2..f662bf1c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +2.037005 - 2017-12-22 + + [BUG FIXES] + + * Alter order of snmp_auth and device_auth config build + 2.037004 - 2017-12-21 [BUG FIXES] diff --git a/lib/App/Netdisco/Configuration.pm b/lib/App/Netdisco/Configuration.pm index ec7e2fb2..25f8e034 100644 --- a/lib/App/Netdisco/Configuration.pm +++ b/lib/App/Netdisco/Configuration.pm @@ -53,13 +53,12 @@ if (ref {} eq ref setting('database')) { # always set this $ENV{DBIC_TRACE_PROFILE} = 'console'; -# if snmp_auth or device_auth not set, add defaults to community{_rw} +# if snmp_auth and device_auth not set, add defaults to community{_rw} if ((setting('snmp_auth') and 0 == scalar @{ setting('snmp_auth') }) - or (setting('device_auth') and 0 == scalar @{ setting('device_auth') })) { + and (setting('device_auth') and 0 == scalar @{ setting('device_auth') })) { config->{'community'} = [ @{setting('community')}, 'public' ]; config->{'community_rw'} = [ @{setting('community_rw')}, 'private' ]; } - # fix up device_auth (or create it from old snmp_auth and community settings) config->{'device_auth'} = [ App::Netdisco::Util::SNMP::fixup_device_auth() ]; diff --git a/lib/App/Netdisco/Util/SNMP.pm b/lib/App/Netdisco/Util/SNMP.pm index f75dcf73..3fa6c0a6 100644 --- a/lib/App/Netdisco/Util/SNMP.pm +++ b/lib/App/Netdisco/Util/SNMP.pm @@ -32,7 +32,7 @@ config changes over time. Returns a list which can replace C. =cut sub fixup_device_auth { - my $config = (setting('device_auth') || setting('snmp_auth') || []); + my $config = (setting('snmp_auth') || setting('device_auth')); my @new_stanzas = (); # new style snmp config diff --git a/share/config.yml b/share/config.yml index 07d0d387..cc0c9bde 100644 --- a/share/config.yml +++ b/share/config.yml @@ -179,7 +179,7 @@ host_groups: device_identity: [] community: [] community_rw: [] -snmp_auth: [] +device_auth: [] get_community: "" bulkwalk_off: false bulkwalk_no: []