Skip to content

Commit

Permalink
Avoid Perl warning when client.conf contains unknown value
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Feb 17, 2021
1 parent 91dd770 commit afd1362
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/OpenQA/UserAgent.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2018 SUSE LLC
# Copyright (C) 2018-2021 SUSE LLC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -43,7 +43,9 @@ sub new {
for my $i (qw(key secret)) {
my $attr = "api$i";
next if $self->$attr;
(my $val = $cfg->val($args{api}, $i)) =~ s/\s+$//; # remove trailing whitespace
my $val = $cfg->val($args{api}, $i);
next unless $val;
$val =~ s/\s+$//; # remove trailing whitespace
$self->$attr($val);
}
last;
Expand Down

0 comments on commit afd1362

Please sign in to comment.