Skip to content

Commit 6c617b4

Browse files
committed
Use dedicated option to download iso and hdd with archive subcommand
Based on the history this did not meant to download other assets than 'other' assets and it is implemeted using the `asset-size-limit` parameter, which was set in a quite small size. #1571 (comment) With this size in place, the error is confusing and not intuitive. It makes more sense to remove the limit in case you want to get the full assets. - Introduce `--all` to skip _asset-size-limit_ - keep _asset-size-limit_ for the 'other' assets Signed-off-by: Ioannis Bonatakis <[email protected]>
1 parent d5a8af5 commit 6c617b4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

lib/OpenQA/CLI/archive.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ sub command ($self, @args) {
2121
url => $url,
2222
archive => $path,
2323
'with-thumbnails' => $options{'with-thumbnails'},
24-
'asset-size-limit' => $options{'asset-size-limit'}});
24+
'asset-size-limit' => $options{'asset-size-limit'},
25+
'all' => $options{'all'}});
2526

2627
return 0;
2728
}

lib/OpenQA/Client/Archive.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ sub run ($self, $options) {
1818
my $res = $req->res;
1919
my $default_max_asset_size = 1024 * 1024 * 200;
2020
$options->{'asset-size-limit'} //= $default_max_asset_size;
21-
$self->client->max_response_size($options->{'asset-size-limit'});
21+
$options->{'all'} //= 0;
22+
$self->client->max_response_size($options->{'all'} ? 0 : $options->{'asset-size-limit'});
2223

2324
my $code = $res->code;
2425
die "There's an error openQA client returned $code" unless $code eq 200;
@@ -32,7 +33,7 @@ sub run ($self, $options) {
3233
delete($job->{assets}->{repo});
3334

3435
$path->child('testresults', 'thumbnails')->make_path if $options->{'with-thumbnails'};
35-
$self->_download_assets($url, $job, $path);
36+
$self->_download_assets($url, $job, $path) if $options->{'all'};
3637
$self->_download_test_results($url, $job, $path, $options);
3738
}
3839

public/openqa-cli.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ subcommands:
163163
options:
164164
- asset-size-limit|l=i --Asset size limit in bytes
165165
- with-thumbnails|t --Download thumbnails as well
166+
- all|a --Download including iso, hdd as well
166167

167168
schedule:
168169
summary: Schedules a set of jobs (via "isos post" creating a schedule product)

0 commit comments

Comments
 (0)