Description of problem: If I create and apply a filter rule (have tried include and exclude) and use the --repositories option to limit this filter to a particular repo there is no error message but the filter rules applies for all repos inside the CV: hammer content-view filter create --type rpm --name 'excluding-emacs' --description 'Excluding emacs package' --inclusion=false --organization "$ORG" --repositories 'Red Hat Enterprise Linux 6 Server RPMs x86_64 6.5' --content-view "cv-os-rhel-6Server" hammer content-view filter rule create --name 'emacs*' --organization "$ORG" --content-view "cv-os-rhel-6Server" --content-view-filter 'excluding-emacs' If I use the --repository-id option instead of name it works as expected: REPOID=$(hammer --csv repository list --name 'Red Hat Enterprise Linux 6 Server RPMs x86_64 6.5' --organization $ORG | grep -vi '^ID' | awk -F',' '{print $1}') hammer content-view filter create --type rpm --name 'excluding-emacs' --description 'Excluding emacs package' --inclusion=false --organization "$ORG" --repository-ids ${REPOID} --content-view "cv-os-rhel-6Server" hammer content-view filter rule create --name 'emacs*' --organization "$ORG" --content-view "cv-os-rhel-6Server" --content-view-filter 'excluding-emacs' Version-Release number of selected component (if applicable): 6.1 Beta How reproducible: See above. Steps to Reproduce: 1. create a CV and add repos 2. create a filter + rule using --repositories option 3. publish CV and check if the filter affects only this or all repos inside CV Actual results: Affected Repositories: all Expected results: Affected Repositories: the one I've specified Additional info:
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
For custom repos, I am getting an error: hammer -u admin -p changeme content-view filter create --name 'test1112' --content-view-id 83 --type rpm --inclusion false --repositories OaiTYcRfJeGtArl --organization qA8YPy Could not create the filter: Error: Could not find repository, please set one of options --repositories, --repository-ids. Functionality works fine in case we use repository-ids as mentioned in initial issue description So we have change in behavior or two defects. Will try to check with Red Hat repos.
Same for Red Hat repos: hammer -u admin -p changeme content-view filter create --name 'Test01' --content-view-id 86 --type rpm --inclusion false --repositories 'Red Hat Enterprise Virtualization Agents for RHEL 6 Workstation RPMs x86_64 6Workstation' --organization qA8YPy Could not create the filter: Error: Could not find repository, please set one of options --repositories, --repository-ids.
Created redmine issue http://projects.theforeman.org/issues/14147 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/14147 has been closed ------------- Andrew Kofink Applied in changeset commit:hammer-cli-katello|76dd9c5576363a90a79800e730676f9aac8c523f.
Created attachment 1174489 [details] packages after filter applied
Created attachment 1174490 [details] content view info
The filter gets applied only to repositories specified by --repositories option Verified on RHEL7, snap 18.1
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/RHBA-2016:1501