Skip to content

Commit

Permalink
Remove uncovered as unused asset_list call (#1675)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo authored Jun 3, 2018
1 parent 2eedfb2 commit e68ebe2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
22 changes: 0 additions & 22 deletions lib/OpenQA/Resource/Jobs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
11 changes: 0 additions & 11 deletions lib/OpenQA/ResourceAllocator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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) = @_;
Expand Down
16 changes: 0 additions & 16 deletions t/04-scheduler.t
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit e68ebe2

Please sign in to comment.