This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1471798 - Cannot delete scap-content via name from CLI
Cannot delete scap-content via name from CLI
Status: VERIFIED
Product: Red Hat Satellite 6
Classification: Red Hat
Component: SCAP Plugin (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: --
Assigned To: Marek Hulan
Nikhil Kathole
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-17 09:00 EDT by Sanket Jagtap
Modified: 2017-08-23 01:16 EDT (History)
4 users (show)

See Also:
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:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20320 None None None 2017-07-17 10:05 EDT

  None (edit)
Description Sanket Jagtap 2017-07-17 09:00:33 EDT
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 10:05:08 EDT
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 10:05:37 EDT
Created redmine issue http://projects.theforeman.org/issues/20320 from this bug
Comment 4 pm-sat@redhat.com 2017-07-17 12:04:02 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 5 pm-sat@redhat.com 2017-07-17 12:04:05 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 6 pm-sat@redhat.com 2017-07-17 14:04:09 EDT
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 01:16:23 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.