Revert "only resolve fqdn once"

This reverts commit 3d136a54de.
This commit is contained in:
Oliver Gorwits
2017-05-23 20:10:20 +01:00
parent d8d082b30e
commit cc4f680f01

View File

@@ -30,15 +30,14 @@ our @EXPORT_OK = qw/
/;
our %EXPORT_TAGS = ( all => \@EXPORT_OK );
# this can take a few seconds - only do it once
our $fqdn = hostfqdn || 'localhost';
sub _getsome {
my ($num_slots, $where) = @_;
return () if ((!defined $num_slots) or ($num_slots < 1));
return () if ((!defined $where) or (ref {} ne ref $where));
my $fqdn = hostfqdn || 'localhost';
my $jobs = schema('netdisco')->resultset('Admin');
my $rs = $jobs->search({
status => 'queued',
device => { '-not_in' =>
@@ -72,6 +71,7 @@ sub jq_getsomep {
}
sub jq_locked {
my $fqdn = hostfqdn || 'localhost';
my @returned = ();
my $rs = schema('netdisco')->resultset('Admin')
@@ -112,6 +112,7 @@ sub _get_denied_actions {
}
sub jq_prime_skiplist {
my $fqdn = hostfqdn || 'localhost';
my @devices = schema('netdisco')->resultset('Device')->all;
my $rs = schema('netdisco')->resultset('DeviceSkip');
my %actionset = ();
@@ -135,6 +136,7 @@ sub jq_prime_skiplist {
sub jq_lock {
my $job = shift;
my $fqdn = hostfqdn || 'localhost';
my $happy = false;
# need to handle device discovered since backend daemon started
@@ -183,6 +185,7 @@ sub jq_lock {
sub jq_defer {
my $job = shift;
my $fqdn = hostfqdn || 'localhost';
my $happy = false;
# note this taints all actions on the device. for example if both