Bug 1338780

Summary: Unable to update content host name via hammer
Product: Red Hat Satellite Reporter: Andrii Balakhtar <abalakht>
Component: HammerAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: akofink, bbuckingham, jsherril
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15589
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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:
Embargoed:

Description Andrii Balakhtar 2016-05-23 12:20:35 UTC
Description of problem:
Unable to update content host name via 'hammer content-host update' command - operation succeeds but name is not updating.

Version-Release number of selected component (if applicable):
Sat 6.2.0 GA SNAP 12.1

How reproducible:
Always

Steps to Reproduce:
1. Create any content host:
hammer host subscription register --content-view-id="30" --organization-id="31" --name="XehsTnSPdubYUBECpJJq" --lifecycle-environment-id="30"
2. Get content host info:
hammer content-host info --id="2"
3. Update content-host name via hammer:
hammer content-host update --id="f2cef045-2381-4700-8013-ebbea6a2f141" --new-name="mjbhe8gnp34ihmtocyuusqfk8nzvbokn"
4. Get content-host info again, check its name
hammer content-host info --id="f2cef045-2381-4700-8013-ebbea6a2f141"

Actual results:
Content host name was not updated (although 'Content host updated' message received):
hammer content-host info --id="f2cef045-2381-4700-8013-ebbea6a2f141"
Name:                    XehsTnSPdubYUBECpJJq
ID:                      f2cef045-2381-4700-8013-ebbea6a2f141
Katello Agent Installed: no
Location:                None
Lifecycle Environment:   Library
Content View:            Default Organization View
Entitlement Status:      valid
Release Version:         
Autoheal:                true
Security Errata:         0
Bugfix Errata:           0
Enhancement Errata:      0


Expected results:
Content host name should be updated. And if it wasn't updated for some reason - 'hammer content-host update' should return error message with non-zero return code.

Additional info:

Comment 2 Justin Sherrill 2016-05-23 17:11:14 UTC
Note, that as part of host unification hosts and content hosts are now combined into one object, (the host object).

So you can update the host's name (via hammer host update), but we really aren't supporting updating of the hammer content host view's name anymore.

Comment 4 Andrew Kofink 2016-07-06 14:10:02 UTC
Created redmine issue http://projects.theforeman.org/issues/15589 from this bug

Comment 5 Bryan Kearney 2016-07-11 14:14:48 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15589 has been closed

Comment 10 Peter Ondrejka 2016-10-24 08:19:33 UTC
Verified in Sat 6.3 snap 5. The content-host sub-command has been removed but the update procedure works correctly under host:

# hammer host subscription register --content-view-id="1" --organization-id="31" --name="XehsTnSPdubYUBECpJJq" --lifecycle-environment-id="1"

# hammer host update --id="5" --new-name updated-name
Host updated

Comment 11 Satellite Program 2018-02-21 16:54:17 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