Bug 1883715 - hammer content-view filter create is missing '-original-module-streams'
Summary: hammer content-view filter create is missing '-original-module-streams'
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-30 00:46 UTC by gtaylor
Modified: 2021-04-29 07:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5468181 0 None None None 2020-10-06 18:36:39 UTC

Description gtaylor 2020-09-30 00:46:59 UTC
Description of problem:
When creating a module filter to 'Include all modules without errata' the hammer option '--original-module-streams' is missing.  The GUI has a checkbox and when clicking the checkbox, production.log has verbage about the option: 

2020-09-29T16:53:37 [I|app|85a96c3c]   Parameters: {"inclusion"=>true, "original_module_streams"=>true,
<additional log text deleted> 

The option works when using the GUI. 

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

How reproducible:
Always. 


Steps to Reproduce:
1. Get the repository IDs for RHEL 8 Base OS and AppStream for use in the next command.  
# hammer repository list --organization acme | egrep 'BaseOS RPMs 8|AppStream RPMs 8'

2. # hammer content-view create --name rhel8-module-test-1 --repository-ids 3,4 --organization acme 

3. # hammer content-view filter create --content-view rhel8-module-test  --name  "include all modules without errata"  --type modulemd --inclusion true --original-module-streams true --organization acme


Actual results:
Could not create the filter:
  Error: Unrecognised option '--original-module-streams'.


Expected results:
Works without error when using hammer.


Additional info:
The option '--original-packages true' seems like it might be an option, but fails.  That is for RPMs:
# hammer content-view filter create --content-view rhel8-module-test  --name  "include all modules without errata"  --type modulemd --inclusion true --original-packages true --organization acme
Could not create the filter:
  setting original_packages not supported for Katello::ContentViewModuleStreamFilter




Works in Satellite 6.8:
[root@sat68fips ~]# hammer content-view filter create --content-view rhel8-module-test-1 --name "include all modules without errata"  --type modulemd --inclusion true --original-module-streams true --organization acme
Filter created.

Satellite 6.8 includes help with the option present(--original-module-streams ORIGINAL_MODULE_STREAMS). See below.  
[root@sat68fips ~]# hammer content-view filter create --help
Usage:
    hammer content-view filter create [OPTIONS]
 
Options:
 --content-view[-id]                               Set the current content view context for the request. Name/Id can be used
 --description DESCRIPTION                         Description of the filter
 --inclusion INCLUSION                             Specifies if content should be included or excluded, default:
                                                   Inclusion=false
                                                   One of true/false, yes/no, 1/0.
 --name NAME                                       Name of the filter
 --organization ORGANIZATION_NAME                  Organization name to search by
 --organization-id ORGANIZATION_ID                 Organization ID to search by
 --organization-label ORGANIZATION_LABEL           Organization label to search by
 --original-module-streams ORIGINAL_MODULE_STREAMS Add all module streams without errata to the included/excluded list.           <=============== this option
                                                   (module stream filter only)
                                                   One of true/false, yes/no, 1/0.
 --original-packages ORIGINAL_PACKAGES             Add all packages without errata to the included/excluded list. (package
                                                   Filter only)
                                                   One of true/false, yes/no, 1/0.
 --product[-id]                                    Set the current product context for the request. Name/Id can be used
 --repositor[ies|y-ids]                            List of repository Names/Ids
                                                   Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                                   JSON is acceptable and preferred way for complex parameters
 --type TYPE                                       Type of filter (e.g. rpm, package_group, erratum, docker, modulemd)
 -h, --help                                        Print help

This text(--original-module-streams ORIGINAL_MODULE_STREAMS) is not in 6.7.3:

Comment 1 Samir Jha 2021-01-04 19:36:16 UTC
Could you run the hammer command with the `-r` option? The --original-module-streams option is available in the API based on UI behavior. Hammer likely is using  the old api cache. You could also try running `foreman-rake apipie:cache` to regenerate the api cache.

Comment 2 gtaylor 2021-01-08 21:20:41 UTC
I cannot duplicate the issue on 6.7.5 and the 6.7.3 system doesn't exist now.  If I understand what you're saying, if I install a fresh 6.7.3 system the issue may not exist anyway because the api cache would be clean?  

So I believe it is not worth installing 6.7.3.  Correct?

Comment 3 Samir Jha 2021-01-11 17:38:57 UTC
(In reply to gtaylor from comment #2)
> I cannot duplicate the issue on 6.7.5 and the 6.7.3 system doesn't exist
> now.  If I understand what you're saying, if I install a fresh 6.7.3 system
> the issue may not exist anyway because the api cache would be clean?  
> 
> So I believe it is not worth installing 6.7.3.  Correct?
 
That is correct. An out of date Apipie cache on hammer would cause this issue and can be fixed with the -r flag or refreshing cache.


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