Bug #21124
closedDownload option for scap-content in CLI shows error undefined method `[]' for nil:NilClass
Description
How reproducible:
Steps to Reproduce:
1. hammer scap-content list
---|------------------------------
ID | TITLE
---|------------------------------
14 | apple
2 | Red Hat jre default content
3 | Red Hat rhel6 default content
4 | Red Hat rhel7 default content
---|------------------------------
2. hammer scap-content --help
Usage:
hammer scap-content [OPTIONS] SUBCOMMAND [ARG] ...
Parameters:
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands:
create Create SCAP content
delete Deletes an SCAP content
download Show an SCAP content as XML
info Show an SCAP content
list List SCAP contents
update Update an SCAP content
Options:
-h, --help print help
3. hammer scap-content download --help
Usage:
hammer scap-content download [OPTIONS]
Options:
--id ID
--path PATH Path to directory where downloaded file will be saved
--title TITLE SCAP content title
-h, --help print help
4. hammer scap-content download --id=14 --path=/var
Could not download the SCAP content file:
Error: undefined method `[]' for nil:NilClass
Actual results:
Could not able to download scap-content.
Expected results:
Scap-content should be downloaded.
Additional info:
Happens only when scap content was uploaded without original_filename attribute.