Skip to content

Commit

Permalink
Moved openssh to a recommends & validate existence in plugin startup
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 15, 2023
1 parent 2ec35a3 commit c80a3a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ devel_requires:
main_requires:
'%assetpack_requires':
git-core:
openssh-common: # for Build Service Authentication
hostname: # for script/configure-web-proxy
bsdtar: # for extraction feature of OpenQA::Downloader
perl(aliased):
Expand Down
2 changes: 2 additions & 0 deletions dist/rpm/openQA.spec
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Recommends: qemu
Recommends: rsync
# Optionally enabled with USE_PNGQUANT=1
Recommends: pngquant
# for Build Service Authentication
Recommends: openssh-common
%if 0%{?suse_version} >= 1330
Requires(pre): group(nogroup)
%endif
Expand Down
5 changes: 4 additions & 1 deletion lib/OpenQA/WebAPI/Plugin/ObsRsync.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Mojo::File;
use Mojo::URL;
use Mojo::UserAgent;
use POSIX 'strftime';

use File::Which qw(which);
use OpenQA::Log qw(log_error);

my $dirty_status_filename = '.dirty_status';
Expand Down Expand Up @@ -40,6 +40,9 @@ sub register {
my $plugin_r = $app->routes->find('ensure_operator');
my $plugin_api_r = $app->routes->find('api_ensure_operator');

# ssh-keygen is needed for the Build Service authentication.
die("ssh-keygen is not availabe. Aborting.\n") unless which('ssh-keygen');

if (!$plugin_r) {
$app->log->error('Routes not configured, plugin ObsRsync will be disabled') unless $plugin_r;
}
Expand Down

0 comments on commit c80a3a1

Please sign in to comment.