Skip to content

Commit e68ebe2

Browse files
authored
Remove uncovered as unused asset_list call (os-autoinst#1675)
1 parent 2eedfb2 commit e68ebe2

File tree

3 files changed

+0
-49
lines changed

3 files changed

+0
-49
lines changed

Diff for: lib/OpenQA/Resource/Jobs.pm

-22
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,4 @@ sub job_restart {
131131
return @duplicated;
132132
}
133133

134-
#
135-
# Assets API
136-
#
137-
138-
sub asset_list {
139-
my %args = @_;
140-
141-
my %cond;
142-
my %attrs;
143-
144-
if ($args{limit}) {
145-
$attrs{rows} = $args{limit};
146-
}
147-
$attrs{page} = $args{page} || 0;
148-
149-
if ($args{type}) {
150-
$cond{type} = $args{type};
151-
}
152-
153-
return schema->resultset("Assets")->search(\%cond, \%attrs);
154-
}
155-
156134
1;

Diff for: lib/OpenQA/ResourceAllocator.pm

-11
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ sub _is_method_allowed {
8080
}
8181

8282

83-
84-
## Assets
85-
dbus_method('asset_list', [['dict', 'string', 'string']], [['array', ['dict', 'string', 'string']]]);
86-
sub asset_list {
87-
my ($self, $args) = @_;
88-
my $rs = safe_call 'OpenQA::Resource::Jobs' => asset_list => %$args;
89-
return [] if @$rs == 0;
90-
@$rs[0]->result_class('DBIx::Class::ResultClass::HashRefInflator');
91-
return [@$rs[0]->all];
92-
}
93-
9483
dbus_method('job_restart', [['array', 'uint32']], [['array', 'uint32']]);
9584
sub job_restart {
9685
my ($self, $args) = @_;

Diff for: t/04-scheduler.t

-16
Original file line numberDiff line numberDiff line change
@@ -419,22 +419,6 @@ ok($result && !defined $no_job_id, "job_delete");
419419
$current_jobs = list_jobs();
420420
is_deeply($current_jobs, [], "no jobs listed");
421421

422-
my $rs = OpenQA::Resource::Jobs::asset_list();
423-
$rs->result_class('DBIx::Class::ResultClass::HashRefInflator');
424-
is_deeply(
425-
nots($rs->all()),
426-
{
427-
id => 1,
428-
name => "whatever.iso",
429-
type => "iso",
430-
size => undef,
431-
checksum => undef,
432-
last_use_job_id => undef,
433-
fixed => 0,
434-
},
435-
"asset list"
436-
);
437-
438422
my $asset = $schema->resultset('Assets')->register('iso', $settings{ISO});
439423
is($asset->name, $settings{ISO}, "asset register returns same");
440424

0 commit comments

Comments
 (0)