Bug 1905041

Summary: Missing hammer command "hammer scap-content bulk-upload".
Product: Red Hat Satellite Reporter: Jameer Pathan <jpathan>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: mhulan, oprazak, ssainkar, zhunting
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-hammer_cli_foreman_openscap-0.1.12,tfm-rubygem-hammer_cli_foreman_openscap-0.1.12-1 Doc Type: Known Issue
Doc Text:
The `hammer scap-content bulk-upload` command to upload default SCAP content on Satellite does not work as expected; it produces the following error: “Error: No such sub-command 'bulk-upload'.”
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:24:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1905567    
Bug Blocks:    

Description Jameer Pathan 2020-12-07 11:59:51 UTC
Description of problem:
Missing hammer command "hammer scap-content bulk-upload".

Version-Release number of selected component (if applicable):
-Satellite 6.9.0 snap 4

How reproducible:
-Always

Steps to Reproduce:
1. "hammer scap-content bulk-upload"


Actual results:
Error: No such sub-command 'bulk-upload'.

Expected results:
- Default scap content uploaded on satellite

Additional info:
- Upstream issue https://projects.theforeman.org/issues/25387 is already fixed.

Comment 1 Bryan Kearney 2020-12-07 12:01:28 UTC
Upstream bug assigned to oprazak

Comment 2 Bryan Kearney 2020-12-07 12:01:31 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/25387 has been resolved.

Comment 5 Jameer Pathan 2021-01-12 12:37:24 UTC
Verified 

Verified with:
- Satellite 6.9.0 snap 8
- tfm-rubygem-hammer_cli_foreman_openscap-0.1.12-1.el7sat.noarch

Test steps:
hammer> scap-content bulk-upload --type directory --directory /tmp
Errors:                 
  
Uploaded Scap Contents: 
 1) Id:                31
    Title:             rhel6 content
    Original Filename: ssg-rhel6-ds.xml
 2) Id:                32
    Title:             rhel7 content
    Original Filename: ssg-rhel7-ds.xml
 3) Id:                33
    Title:             rhel8 content
    Original Filename: ssg-rhel8-ds.xml

hammer> scap-content bulk-upload --type files --files '/tmp/ssg-rhel6-ds.xml,/tmp/ssg-rhel8-ds.xml'
Errors:                 
  
Uploaded Scap Contents: 
 1) Id:                34
    Title:             rhel6 content
    Original Filename: ssg-rhel6-ds.xml
 2) Id:                35
    Title:             rhel8 content
    Original Filename: ssg-rhel8-ds.xml

Scap Contents uploaded.
hammer> scap-content bulk-upload --type default
Errors:                 
  
Uploaded Scap Contents: 
 1) Id:                36
    Title:             Red Hat firefox default content
    Original Filename: ssg-firefox-ds.xml
 2) Id:                37
    Title:             Red Hat jre default content
    Original Filename: ssg-jre-ds.xml
 3) Id:                38
    Title:             Red Hat rhel6 default content
    Original Filename: ssg-rhel6-ds.xml
 4) Id:                39
    Title:             Red Hat rhel7 default content
    Original Filename: ssg-rhel7-ds.xml
 5) Id:                40
    Title:             Red Hat rhel8 default content
    Original Filename: ssg-rhel8-ds.xml

Scap Contents uploaded.

hammer> scap-content bulk-upload --help
Usage:
    scap-content [OPTIONS]

Options:
 --directory DIRECTORY             Directory to upload when using “directory” upload type
 --files FILES                     File paths to upload when using “files” upload type
                                   Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                   JSON is acceptable and preferred way for complex parameters
 --location[-id]                   Set the current location context for the request. Name/Id can be used
 --organization[-id]               Set the current organization context for the request. Name/Id can be used
 --type TYPE                       Type of the upload
                                   Possible value(s): 'files', 'directory', 'default'
 -h, --help                        Print help

Observations:
- “hammer scap-content bulk-upload” command uploads scap contents to satellite 
either by providing directory path or comma separated files path to scap contents.
- It also uploads default scap contents to satellite.

Comment 9 errata-xmlrpc 2021-04-21 13:24:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1313

Comment 10 Red Hat Bugzilla 2023-09-15 00:52:36 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days