|
|
ee3ddb4 |
From c589991e8000785e4e3a433ac99422f2bd5688c8 Mon Sep 17 00:00:00 2001
|
|
|
ee3ddb4 |
From: Adam Williamson <awilliam@redhat.com>
|
|
|
ee3ddb4 |
Date: Mon, 20 Jun 2022 16:45:35 -0700
|
|
|
ee3ddb4 |
Subject: [PATCH] Fix perl 5.36 warnings on use of @_ in functions with
|
|
|
ee3ddb4 |
signature
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
As with os-autoinst, building openQA with perl 5.36 results in
|
|
|
ee3ddb4 |
test failures due to several cases of subs with signatures using
|
|
|
ee3ddb4 |
`@_`, which they are not supposed to do. Fortunately the fixes
|
|
|
ee3ddb4 |
are fairly straightforward here.
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
|
|
ee3ddb4 |
---
|
|
|
ee3ddb4 |
lib/OpenQA/Log.pm | 16 ++++++++--------
|
|
|
ee3ddb4 |
lib/OpenQA/Worker/Engines/isotovideo.pm | 9 +++++++--
|
|
|
ee3ddb4 |
script/openqa-dump-templates | 2 +-
|
|
|
ee3ddb4 |
t/api/04-jobs.t | 3 +--
|
|
|
ee3ddb4 |
4 files changed, 17 insertions(+), 13 deletions(-)
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
diff --git a/lib/OpenQA/Log.pm b/lib/OpenQA/Log.pm
|
|
|
ee3ddb4 |
index 403f0dd09..ebd3f8535 100644
|
|
|
ee3ddb4 |
--- a/lib/OpenQA/Log.pm
|
|
|
ee3ddb4 |
+++ b/lib/OpenQA/Log.pm
|
|
|
ee3ddb4 |
@@ -41,23 +41,23 @@ my %LOG_DEFAULTS = (LOG_TO_STANDARD_CHANNEL => 1, CHANNELS => []);
|
|
|
ee3ddb4 |
# log_debug("message");
|
|
|
ee3ddb4 |
# log_debug("message", channels=>'channel1')
|
|
|
ee3ddb4 |
# log_debug("message", channels=>'channel1', standard=>0)
|
|
|
ee3ddb4 |
-sub log_debug (@) { _log_msg('debug', @_); }
|
|
|
ee3ddb4 |
+sub log_debug (@args) { _log_msg('debug', @args); }
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
# log_trace("message"[, param1=>val1, param2=>val2]);
|
|
|
ee3ddb4 |
-sub log_trace (@) { _log_msg('trace', @_); }
|
|
|
ee3ddb4 |
+sub log_trace (@args) { _log_msg('trace', @args); }
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
# log_info("message"[, param1=>val1, param2=>val2]);
|
|
|
ee3ddb4 |
-sub log_info (@) { _log_msg('info', @_); }
|
|
|
ee3ddb4 |
+sub log_info (@args) { _log_msg('info', @args); }
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
# log_warning("message"[, param1=>val1, param2=>val2]);
|
|
|
ee3ddb4 |
-sub log_warning (@) { _log_msg('warn', @_); }
|
|
|
ee3ddb4 |
+sub log_warning (@args) { _log_msg('warn', @args); }
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
# log_error("message"[, param1=>val1, param2=>val2]);
|
|
|
ee3ddb4 |
-sub log_error (@) { _log_msg('error', @_); }
|
|
|
ee3ddb4 |
+sub log_error (@args) { _log_msg('error', @args); }
|
|
|
ee3ddb4 |
# log_fatal("message"[, param1=>val1, param2=>val2]);
|
|
|
ee3ddb4 |
-sub log_fatal (@) {
|
|
|
ee3ddb4 |
- _log_msg('fatal', @_);
|
|
|
ee3ddb4 |
- croak $_[0];
|
|
|
ee3ddb4 |
+sub log_fatal (@args) {
|
|
|
ee3ddb4 |
+ _log_msg('fatal', @args);
|
|
|
ee3ddb4 |
+ croak $args[0];
|
|
|
ee3ddb4 |
}
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
sub _current_log_level () {
|
|
|
ee3ddb4 |
diff --git a/lib/OpenQA/Worker/Engines/isotovideo.pm b/lib/OpenQA/Worker/Engines/isotovideo.pm
|
|
|
ee3ddb4 |
index eae022fb3..7a0e9eaa9 100644
|
|
|
ee3ddb4 |
--- a/lib/OpenQA/Worker/Engines/isotovideo.pm
|
|
|
ee3ddb4 |
+++ b/lib/OpenQA/Worker/Engines/isotovideo.pm
|
|
|
ee3ddb4 |
@@ -98,11 +98,16 @@ sub _poll_cache_service ($job, $cache_client, $request, $delay, $callback) {
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
sub cache_assets ($cache_client, $job, $vars, $assets_to_cache, $assetkeys, $webui_host, $pooldir, $callback) {
|
|
|
ee3ddb4 |
return $callback->(undef) unless my $this_asset = shift @$assets_to_cache;
|
|
|
ee3ddb4 |
- return cache_assets(@_) unless my $asset_value = $vars->{$this_asset};
|
|
|
ee3ddb4 |
+ my $asset_value = $vars->{$this_asset};
|
|
|
ee3ddb4 |
+ unless ($asset_value) {
|
|
|
ee3ddb4 |
+ return cache_assets($cache_client, $job, $vars, $assets_to_cache, $assetkeys, $webui_host, $pooldir, $callback);
|
|
|
ee3ddb4 |
+ }
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
my $asset_uri = trim($asset_value);
|
|
|
ee3ddb4 |
# skip UEFI_PFLASH_VARS asset if the job won't use UEFI
|
|
|
ee3ddb4 |
- return cache_assets(@_) if $this_asset eq 'UEFI_PFLASH_VARS' && !$vars->{UEFI};
|
|
|
ee3ddb4 |
+ if ($this_asset eq 'UEFI_PFLASH_VARS' && !$vars->{UEFI}) {
|
|
|
ee3ddb4 |
+ return cache_assets($cache_client, $job, $vars, $assets_to_cache, $assetkeys, $webui_host, $pooldir, $callback);
|
|
|
ee3ddb4 |
+ }
|
|
|
ee3ddb4 |
# check cache availability
|
|
|
ee3ddb4 |
my $error = $cache_client->info->availability_error;
|
|
|
ee3ddb4 |
return $callback->({error => $error}) if $error;
|
|
|
ee3ddb4 |
diff --git a/script/openqa-dump-templates b/script/openqa-dump-templates
|
|
|
ee3ddb4 |
index 1064abeed..3a8f7bf37 100755
|
|
|
ee3ddb4 |
--- a/script/openqa-dump-templates
|
|
|
ee3ddb4 |
+++ b/script/openqa-dump-templates
|
|
|
ee3ddb4 |
@@ -115,7 +115,7 @@ my %options;
|
|
|
ee3ddb4 |
sub usage ($r) {
|
|
|
ee3ddb4 |
eval "use Pod::Usage; pod2usage($r);";
|
|
|
ee3ddb4 |
die "cannot display help, install perl(Pod::Usage)\n" if $@;
|
|
|
ee3ddb4 |
- exit $_[0];
|
|
|
ee3ddb4 |
+ exit $r;
|
|
|
ee3ddb4 |
}
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
GetOptions(
|
|
|
ee3ddb4 |
diff --git a/t/api/04-jobs.t b/t/api/04-jobs.t
|
|
|
ee3ddb4 |
index 1924b694b..e98eea251 100644
|
|
|
ee3ddb4 |
--- a/t/api/04-jobs.t
|
|
|
ee3ddb4 |
+++ b/t/api/04-jobs.t
|
|
|
ee3ddb4 |
@@ -49,8 +49,7 @@ my $chunk_size = 10000000;
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
my $io_loop_mock = mock_io_loop(subprocess => 1);
|
|
|
ee3ddb4 |
|
|
|
ee3ddb4 |
-sub calculate_file_md5($) {
|
|
|
ee3ddb4 |
- my ($file) = @_;
|
|
|
ee3ddb4 |
+sub calculate_file_md5($file) {
|
|
|
ee3ddb4 |
my $c = path($file)->slurp;
|
|
|
ee3ddb4 |
my $md5 = Digest::MD5->new;
|
|
|
ee3ddb4 |
$md5->add($c);
|
|
|
ee3ddb4 |
--
|
|
|
ee3ddb4 |
2.37.0.rc1
|
|
|
ee3ddb4 |
|