Support for external command to provide device_auth stanza (#532)

* separate out generic device auth to DeviceAuth module

* change config name to get_credentials

* add debug lines and tested
This commit is contained in:
Oliver Gorwits
2019-03-12 13:13:06 +00:00
committed by GitHub
parent 65f695410e
commit b9218d91c8
4 changed files with 170 additions and 116 deletions

View File

@@ -1,7 +1,7 @@
package App::Netdisco::Configuration;
use App::Netdisco::Environment;
use App::Netdisco::Util::SNMP ();
use App::Netdisco::Util::DeviceAuth ();
use Dancer ':script';
use Path::Class 'dir';
@@ -84,7 +84,8 @@ if ((setting('snmp_auth') and 0 == scalar @{ setting('snmp_auth') })
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() ];
config->{'device_auth'}
= [ App::Netdisco::Util::DeviceAuth::fixup_device_auth() ];
# defaults for workers
setting('workers')->{queue} ||= 'PostgreSQL';