From e68ebe2b7569cc04d439a71f7f5abc1b2f48c8bb Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sun, 3 Jun 2018 09:02:10 +0200 Subject: [PATCH] Remove uncovered as unused asset_list call (#1675) --- lib/OpenQA/Resource/Jobs.pm | 22 ---------------------- lib/OpenQA/ResourceAllocator.pm | 11 ----------- t/04-scheduler.t | 16 ---------------- 3 files changed, 49 deletions(-) diff --git a/lib/OpenQA/Resource/Jobs.pm b/lib/OpenQA/Resource/Jobs.pm index 31bbfe7fd00..c653536d696 100644 --- a/lib/OpenQA/Resource/Jobs.pm +++ b/lib/OpenQA/Resource/Jobs.pm @@ -131,26 +131,4 @@ sub job_restart { return @duplicated; } -# -# Assets API -# - -sub asset_list { - my %args = @_; - - my %cond; - my %attrs; - - if ($args{limit}) { - $attrs{rows} = $args{limit}; - } - $attrs{page} = $args{page} || 0; - - if ($args{type}) { - $cond{type} = $args{type}; - } - - return schema->resultset("Assets")->search(\%cond, \%attrs); -} - 1; diff --git a/lib/OpenQA/ResourceAllocator.pm b/lib/OpenQA/ResourceAllocator.pm index 0eb9082e686..0b9e3b20d6b 100644 --- a/lib/OpenQA/ResourceAllocator.pm +++ b/lib/OpenQA/ResourceAllocator.pm @@ -80,17 +80,6 @@ sub _is_method_allowed { } - -## Assets -dbus_method('asset_list', [['dict', 'string', 'string']], [['array', ['dict', 'string', 'string']]]); -sub asset_list { - my ($self, $args) = @_; - my $rs = safe_call 'OpenQA::Resource::Jobs' => asset_list => %$args; - return [] if @$rs == 0; - @$rs[0]->result_class('DBIx::Class::ResultClass::HashRefInflator'); - return [@$rs[0]->all]; -} - dbus_method('job_restart', [['array', 'uint32']], [['array', 'uint32']]); sub job_restart { my ($self, $args) = @_; diff --git a/t/04-scheduler.t b/t/04-scheduler.t index f4a5b88b2cc..8aee469558b 100644 --- a/t/04-scheduler.t +++ b/t/04-scheduler.t @@ -419,22 +419,6 @@ ok($result && !defined $no_job_id, "job_delete"); $current_jobs = list_jobs(); is_deeply($current_jobs, [], "no jobs listed"); -my $rs = OpenQA::Resource::Jobs::asset_list(); -$rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); -is_deeply( - nots($rs->all()), - { - id => 1, - name => "whatever.iso", - type => "iso", - size => undef, - checksum => undef, - last_use_job_id => undef, - fixed => 0, - }, - "asset list" -); - my $asset = $schema->resultset('Assets')->register('iso', $settings{ISO}); is($asset->name, $settings{ISO}, "asset register returns same");