add NETDISCO_RO_COMMUNITY and NETDISCO_RW_COMMUNITY

This commit is contained in:
Oliver Gorwits
2018-01-19 09:14:12 +00:00
parent aef290e34c
commit 22f3c906ad

View File

@@ -72,6 +72,12 @@ if (ref {} eq ref setting('database')) {
# always set this
$ENV{DBIC_TRACE_PROFILE} = 'console';
# override from env for docker
config->{'community'} = ($ENV{NETDISCO_RO_COMMUNITY} ?
[split ',', $ENV{NETDISCO_RO_COMMUNITY}] : config->{'community'});
config->{'community_rw'} = ($ENV{NETDISCO_RW_COMMUNITY} ?
[split ',', $ENV{NETDISCO_RW_COMMUNITY}] : config->{'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') })
and (setting('device_auth') and 0 == scalar @{ setting('device_auth') })) {