Skip to content

Commit

Permalink
Fix some perlcritic complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Aug 12, 2024
1 parent c375b2a commit 50988ad
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/OpenQA/Client/Archive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sub _download_test_result_details ($self, $url, $path, $module, $options) {
# Check if module has images
return 0 unless @dirnames;

my $dir = $module->{'md5_dirname'} || ($module->{'md5_1'} . '/' . $module->{'md5_2'});
my $dir = $module->{md5_dirname} || ($module->{md5_1} . '/' . $module->{md5_2});
$url->path("/image/$dir/$module->{md5_basename}");

my $destination = $path->child('testresults', $module->{screenshot});
Expand Down
4 changes: 2 additions & 2 deletions lib/OpenQA/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ sub run ($self, @args) {
'apikey=s' => sub { $self->apikey($_[1]) },
'apisecret=s' => sub { $self->apisecret($_[1]) },
'host=s' => sub { $self->host($_[1] =~ m!^/|://! ? $_[1] : "https://$_[1]") },
'o3' => sub { $self->host('https://openqa.opensuse.org') },
'osd' => sub { $self->host('http://openqa.suse.de') },
o3 => sub { $self->host('https://openqa.opensuse.org') },
osd => sub { $self->host('http://openqa.suse.de') },
'L|links' => \$options{links},
'name=s' => sub { $self->name($_[1]) },
'p|pretty' => \$options{pretty},
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Scheduler/WorkerSlotPicker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sub _id_or_skip ($self, $worker, $visited_worker_slots_by_id) {
return $id;
}

sub _pick_one_matching_slot_per_host($self, $job) {
sub _pick_one_matching_slot_per_host ($self, $job) {
my $visited_worker_slots_by_id = $self->{_visited_worker_slots_by_id};
my %visited_worker_slots_by_host;
for my $matching_worker (@{$job->{matching_workers}}) {
Expand Down
12 changes: 6 additions & 6 deletions lib/OpenQA/Schema/Result/JobGroupParents.pm
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,32 @@ sub _get_column_or_default {
return OpenQA::App->singleton->config->{default_group_limits}->{$setting};
}

around 'default_keep_logs_in_days' => sub {
around default_keep_logs_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('default_keep_logs_in_days', 'log_storage_duration');
};

around 'default_keep_important_logs_in_days' => sub {
around default_keep_important_logs_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('default_keep_important_logs_in_days', 'important_log_storage_duration');
};

around 'default_keep_results_in_days' => sub {
around default_keep_results_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('default_keep_results_in_days', 'result_storage_duration');
};

around 'default_keep_important_results_in_days' => sub {
around default_keep_important_results_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('default_keep_important_results_in_days', 'important_result_storage_duration');
};

around 'default_priority' => sub {
around default_priority => sub {
my ($orig, $self) = @_;
return $self->get_column('default_priority') // OpenQA::JobGroupDefaults::PRIORITY;
};

around 'carry_over_bugrefs' => sub {
around carry_over_bugrefs => sub {
my ($orig, $self) = @_;
return $self->get_column('carry_over_bugrefs') // OpenQA::JobGroupDefaults::CARRY_OVER_BUGREFS;
};
Expand Down
14 changes: 7 additions & 7 deletions lib/OpenQA/Schema/Result/JobGroups.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sub _get_column_or_default {
return $limits->{$setting};
}

around 'size_limit_gb' => sub {
around size_limit_gb => sub {
my ($orig, $self) = @_;

if (defined(my $own_value = $self->get_column('size_limit_gb'))) {
Expand All @@ -122,33 +122,33 @@ around 'size_limit_gb' => sub {
# the parent group. So the default is directly read from the config.
};

around 'keep_logs_in_days' => sub {
around keep_logs_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('keep_logs_in_days', 'log_storage_duration');
};

around 'keep_important_logs_in_days' => sub {
around keep_important_logs_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('keep_important_logs_in_days', 'important_log_storage_duration');
};

around 'keep_results_in_days' => sub {
around keep_results_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('keep_results_in_days', 'result_storage_duration');
};

around 'keep_important_results_in_days' => sub {
around keep_important_results_in_days => sub {
my ($orig, $self) = @_;
return $self->_get_column_or_default('keep_important_results_in_days', 'important_result_storage_duration');
};

around 'default_priority' => sub {
around default_priority => sub {
my ($orig, $self) = @_;
return $self->get_column('default_priority')
// ($self->parent ? $self->parent->default_priority : OpenQA::JobGroupDefaults::PRIORITY);
};

around 'carry_over_bugrefs' => sub {
around carry_over_bugrefs => sub {
my ($orig, $self) = @_;
return $self->get_column('carry_over_bugrefs')
// ($self->parent ? $self->parent->carry_over_bugrefs : OpenQA::JobGroupDefaults::CARRY_OVER_BUGREFS);
Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/Task/Git/Clone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub _get_current_branch ($path) {
return trim($r->{stdout});
}

sub _ssh_git_cmd($git_args) {
sub _ssh_git_cmd ($git_args) {
return ['env', 'GIT_SSH_COMMAND="ssh -oBatchMode=yes"', 'git', @$git_args];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/OpenQA/WebAPI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ sub startup ($self) {

# api/v1/workers
$api_public_r->get('/workers')->name('apiv1_workers')->to('worker#list');
$api_description{'apiv1_worker'}
$api_description{apiv1_worker}
= 'Each entry contains the "hostname", the boolean flag "connected" which can be 0 or 1 depending on the connection to the websockets server and the field "status" which can be "dead", "idle", "running". A worker can be considered "up" when "connected=1" and "status!=dead"';
$api_ro->post('/workers')->name('apiv1_create_worker')->to('worker#create');
$api_public_r->any('/workers/<workerid:num>')->get('/')->name('apiv1_worker')->to('worker#show');
Expand Down
4 changes: 2 additions & 2 deletions lib/OpenQA/WebAPI/Controller/API/V1/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ sub query {
my $lockname = 'webui_query_rate_limit';
if (my $user = $self->current_user) { $lockname .= $user->username }
return $self->render(json => {error => 'Rate limit exceeded'}, status => 400)
unless $self->app->minion->lock($lockname, 60, {limit => $self->app->config->{rate_limits}->{'search'}});
unless $self->app->minion->lock($lockname, 60, {limit => $self->app->config->{rate_limits}->{search}});

my $cap = $self->app->config->{global}->{'search_results_limit'};
my $cap = $self->app->config->{global}->{search_results_limit};
my %results;
my $keywords = $validation->param('q');

Expand Down
4 changes: 2 additions & 2 deletions lib/OpenQA/Worker/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use Time::HiRes qw(usleep);
# define attributes for public properties
has 'worker';
has 'client';
has 'isotovideo_client' => sub { OpenQA::Worker::Isotovideo::Client->new(job => shift) };
has isotovideo_client => sub { OpenQA::Worker::Isotovideo::Client->new(job => shift) };
has 'developer_session_running';
has 'upload_results_interval';

Expand Down Expand Up @@ -252,7 +252,7 @@ sub start {
my $webui_host = $client->webui_host;
($ENV{OPENQA_HOSTNAME}) = $webui_host =~ m|([^/]+:?\d*)/?$|;

$job_settings->{'OPENQA_HOSTNAME'} = $webui_host;
$job_settings->{OPENQA_HOSTNAME} = $webui_host;

$self->{_settings} = $job_settings;
$self->{_name} = $job_settings->{NAME};
Expand Down

0 comments on commit 50988ad

Please sign in to comment.