Bug 1335559 - hammer host-collection add-host/remove-host always return success
Summary: hammer host-collection add-host/remove-host always return success
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer - Content
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Bruno Rocha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-12 13:47 UTC by Andrew Kofink
Modified: 2019-09-25 20:40 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:46:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15291 0 None None None 2016-06-03 18:07:22 UTC
Foreman Issue Tracker 21281 0 None None None 2017-10-10 16:33:45 UTC

Description Andrew Kofink 2016-05-12 13:47:38 UTC
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:

Comment 1 Andrew Kofink 2016-06-03 17:29:55 UTC
Created redmine issue http://projects.theforeman.org/issues/15291 from this bug

Comment 3 Bryan Kearney 2016-08-08 16:15:33 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15291 has been closed

Comment 8 Bruno Rocha 2016-11-14 19:20:43 UTC
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

Comment 9 Bruno Rocha 2016-11-14 19:21:47 UTC
version: satellite-6.3.0-6.1.beta.el7sat.noarch - RHEL7

Comment 10 Bryan Kearney 2016-11-14 21:15:53 UTC
Upstream bug component is Hammer - Content

Comment 11 Bruno Rocha 2017-05-26 06:22:33 UTC
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

Comment 12 Bruno Rocha 2017-09-20 19:03:44 UTC
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

Comment 13 Bruno Rocha 2017-10-26 15:05:40 UTC
[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.

Comment 14 Bryan Kearney 2018-02-21 16:42:20 UTC
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

Comment 15 Bryan Kearney 2018-02-21 16:46:23 UTC
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


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