fix fqdn global to use settings instead

This commit is contained in:
Oliver Gorwits
2017-06-13 07:04:49 +01:00
parent 5d4c8ade10
commit 213df47033
2 changed files with 19 additions and 24 deletions

View File

@@ -22,8 +22,14 @@ BEGIN {
use App::Netdisco;
use Dancer qw/:moose :script/;
BEGIN {
warning sprintf "App::Netdisco %s backend", ($App::Netdisco::VERSION || 'HEAD');
# this can take a few seconds - only do it once
use Net::Domain 'hostfqdn';
info 'resolving backend hostname...';
setting('workers')->{'backend'} ||= (hostfqdn || 'fqdn-undefined');
}
use App::Netdisco::Util::Backend;