Bug 1428376

Summary: Hammer csv content-view-filters fails to export a date-based Erratum filter
Product: Red Hat Satellite Reporter: Francisco Garcia <fgarciad>
Component: Hammer - ContentAssignee: Tom McKay <tomckay>
Status: CLOSED WONTFIX QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.7CC: bbuckingham, bkearney, ehelms, inpro.base, jcallaha, mmccune, tbhowmik, tomckay, tstrachota, vanhoof
Target Milestone: UnspecifiedKeywords: PrioBumpPM, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: hammer-cli-csv-2.3.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 18:06:10 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:

Description Francisco Garcia 2017-03-02 12:37:25 UTC
Description of problem:

Hammer csv content-view-filters cannot properly handle CV Filters that use date-based Erratum. The export has the following output :

Name,Content View,Organization,Type,Description,Repositories,Rules
Errata until 2017-01-01,CV_RHEL72,MyOrg,Include unknown,,"","start = 2000-12-31,end = 2016-12-31,""types = security,enhancement,bugfix"""

The "Include unknown" field is wrong, and makes the import process fail:

Error: 500 Internal Server Error
Errata until 2017-01-01,CV_RHEL72,MyOrg,Include unknown,,"","start = 2000-12-31,end = 2016-12-31,""types = security,enhancement,bugfix"""

Excerpt from foreman/production.log :

2017-03-02 06:19:45 [app] [I] Started POST "/katello/api/content_views/9/filters" for at 2017-03-02 06:19:45 -0500
2017-03-02 06:19:45 [app] [I] Processing by Katello::Api::V2::ContentViewFiltersController#create as JSON
2017-03-02 06:19:45 [app] [I]   Parameters: {"name"=>"Errata until 2017-01-01", "description"=>nil, "type"=>"unknown", "inclusion"=>true, "repository_ids"=>nil, "api_version
"=>"v2", "content_view_id"=>"9", "content_view_filter"=>{"name"=>"Errata until 2017-01-01", "type"=>"unknown", "inclusion"=>true, "description"=>nil, "repository_ids"=>nil}}
2017-03-02 06:19:45 [app] [I] Authorized user admin(Admin User)
2017-03-02 06:19:45 [app] [E] RuntimeError: Invalid content type 'unknown' provided. Content types can be one of rpm, package_group, erratum

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

Satellite 6.2.7

How reproducible:

Steps to Reproduce:
1. Generate a new CV Filter with the following options : 
      - Content type: by date and type
      - Inclusion type: Include
      - Errata type: security, enhancement, bugfix
      - Date type: "Updated on"
      - Start date: <blank>
      - End date:  eg: 2017-01-01
2. hammer csv content-view-filters --export 
3. Try to import the filter in another organization.

Comment 3 Tom McKay 2017-03-07 20:52:46 UTC
Created redmine issue http://projects.theforeman.org/issues/18829 from this bug

Comment 11 Bryan Kearney 2018-09-04 18:06:10 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.