Hide Forgot
Description of problem: The `hammer host-collection add-host/remove-host` commands always return success messages, regardless of whether the hosts added/removed are found. Version-Release number of selected component (if applicable): 6.1,6.2,devel How reproducible: Always Steps to Reproduce: 1. Run the following hammer commands with a valid host collection but invalid host ids `hammer host-collection add-host --id 1 --host-ids 2354,34` `hammer host-collection remove-host --id 1 --host-ids 2354,34` Actual results: The host(s) has been added The host(s) has been removed Expected results: Could not find hosts with IDs 2354,34. No hosts added. Could not find hosts with IDs 2354,34. No hosts removed. Additional info:
Created redmine issue http://projects.theforeman.org/issues/15291 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/15291 has been closed
Verified in: Conclusion: Still failing [root@ibm-x3550m3-09 ~]# hammer -u admin host-collection add-host --id 1 --host-ids 2354,34,899090,666 The host(s) has been added I can put any id in host ids even invalid values as [root@ibm-x3550m3-09 ~]# hammer -u admin -p changeme host-collection add-host --id 1 --host-ids 0 The host(s) has been added also accepts strings [root@ibm-x3550m3-09 ~]# hammer -u admin -p changeme host-collection add-host --id 1 --host-ids banana,ironmaiden,pythonrocks,thisisnotanid The host(s) has been added
version: satellite-6.3.0-6.1.beta.el7sat.noarch - RHEL7
Upstream bug component is Hammer - Content
Problem still exists in 6.2.10 [root@cloud-qe-09 ~]# hammer -u admin -p changeme host-collection add-host --id 1 --host-ids banana,ironmaiden,pythonrocks,thisisnotanid The host(s) has been added [root@cloud-qe-09 ~]# rpm -q satellite satellite-6.2.10-1.0.el7sat.noarch
Problem still happening on 6.3 compose 16 [root@cloud-qe-15 ~]# rpm -q satellite satellite-6.3.0-18.0.beta.el7sat.noarch [root@cloud-qe-15 ~]# hammer -u admin -p changeme host-collection add-host --id 1 --host-ids CeciNestPasUneID The host(s) has been added [root@cloud-qe-15 ~]# hammer host-collection add-host --id 1 --host-ids 2354,34 The host(s) has been added [root@cloud-qe-15 ~]# hammer host-collection remove-host --id 1 --host-ids 2354,34 The host(s) has been removed [root@cloud-qe-15 ~]# hammer host-collection remove-host --id 1 --host-ids CeciNestPasUneID The host(s) has been removed
[root@cloud-qe-19 ~]# rpm -q satellite satellite-6.3.0-21.0.beta.el7sat.noarch [root@cloud-qe-19 ~]# hammer host-collection add-host --id 1 --host-ids 2354,34 Could not add host(s) Host with ID 2354 not found. Host with ID 34 not found. [root@cloud-qe-19 ~]# hammer -u admin -p changeme host-collection add-host --id 1 --host-ids CeciNestPasUneID Could not add host(s) Host with ID 0 not found. [root@cloud-qe-19 ~]# hammer host-collection remove-host --id 1 --host-ids CeciNestPasUneID Could not remove host(s) Host with ID 0 not found.
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