Skip to content

Commit f65fa8f

Browse files
committed
Modify worker code for easier debugging
1 parent 3fc0071 commit f65fa8f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/OpenQA/Worker.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ sub new ($class, $cli_options) {
7070

7171
# determine settings and create app
7272
my $settings = OpenQA::Worker::Settings->new($instance_number, $cli_options);
73-
my $short_hostname = (POSIX::uname)[1];
73+
my $short_hostname = $ENV{FAKE_HOST} // (POSIX::uname)[1];
7474
my $app = OpenQA::Worker::App->new(
7575
mode => 'production',
7676
log_name => 'worker',
@@ -604,6 +604,7 @@ sub is_qemu_running ($self) {
604604
}
605605

606606
sub is_ovs_dbus_service_running ($self) {
607+
return 1;
607608
eval { defined &Net::DBus::system or require Net::DBus };
608609
return 0 if $@;
609610
my $bus = ($self->{_system_dbus} //= Net::DBus->system(nomainloop => 1));

lib/OpenQA/Worker/CommandHandler.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ sub _can_grab_job {
181181
sub _can_accept_job {
182182
my ($client, $webui_host, $job_info, $job_ids_to_grab) = @_;
183183

184+
return undef if $ENV{NO_ACCEPT};
185+
184186
my $job_id_missing = ref($job_info) ne 'HASH' || !defined $job_info->{id};
185187
if ($job_id_missing || !$job_info->{settings}) {
186188
$client->reject_jobs($job_ids_to_grab // [$job_info->{id}], 'the provided job is invalid')

0 commit comments

Comments
 (0)