Bug 1471798

Summary: Cannot delete scap-content via name from CLI
Product: Red Hat Satellite Reporter: Sanket Jagtap <sjagtap>
Component: SCAP PluginAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: ehelms, mhulan, nkathole, oprazak
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hammer_cli_foreman_openscap-0.1.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:40:47 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:

Description Sanket Jagtap 2017-07-17 13:00:33 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Satellite 6.3.0 snap7

How reproducible:
Always 

Steps to Reproduce:
1.Create a scap-content 
2.try to delete it using given name
3.

hammer> scap-content delete --help
Usage:
     scap-content delete [OPTIONS]

Options:
 --id ID
 --name NAME                   Name to search by
 -h, --help                    print help

hammer> scap-content list
---|--------------------------------
ID | TITLE
---|--------------------------------
6  | apple
1  | Red Hat firefox default content
2  | Red Hat jre default content
3  | Red Hat rhel6 default content
4  | Red Hat rhel7 default content
---|--------------------------------


Actual results:
hammer> scap-content delete --name="apple"
Could not delete Scap content:
  Error: 400 Bad Request
hammer> scap-content delete --name "apple"
Could not delete Scap content:
  Error: 400 Bad Request


Expected results:
scap-content should be deleted

Additional info:
It can be deleted via ID parameter
hammer> scap-content delete --id 6
Scap content deleted

Comment 2 Marek Hulan 2017-07-17 14:05:08 UTC
I can reproduce upstream, the issue is that the scap-content does not have name but title. The command needs to be adjusted.

Comment 3 Marek Hulan 2017-07-17 14:05:37 UTC
Created redmine issue http://projects.theforeman.org/issues/20320 from this bug

Comment 4 Satellite Program 2017-07-17 16:04:02 UTC
Upstream bug assigned to mhulan

Comment 5 Satellite Program 2017-07-17 16:04:05 UTC
Upstream bug assigned to mhulan

Comment 6 Satellite Program 2017-07-17 18:04:09 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20320 has been resolved.

Comment 7 Nikhil Kathole 2017-08-23 05:16:23 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 12

steps:

1. Created scap content named as "scap_content"
2. hammer scap-content delete --help
Usage:
    hammer scap-content delete [OPTIONS]

Options:
 --id ID                        
 --title TITLE                 Scap content title
 -h, --help                    print help

3. hammer scap-content list
---|--------------------------------
ID | TITLE                          
---|--------------------------------
1  | Red Hat firefox default content
2  | Red Hat jre default content    
3  | Red Hat rhel6 default content  
4  | Red Hat rhel7 default content  
5  | scap_content                   
---|--------------------------------


4. hammer scap-content delete --title scap_content
Scap content deleted

5. hammer scap-content list
---|--------------------------------
ID | TITLE                          
---|--------------------------------
1  | Red Hat firefox default content
2  | Red Hat jre default content    
3  | Red Hat rhel6 default content  
4  | Red Hat rhel7 default content  
---|--------------------------------

Successfully deleted scap content using title via CLI.

Comment 8 Bryan Kearney 2018-02-21 16:39:10 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, 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-2018:0336

Comment 9 Bryan Kearney 2018-02-21 16:40:47 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, 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-2018:0336

Comment 10 Satellite Program 2018-02-21 16:54:17 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, 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-2018:0336