Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1199137

Summary: hammer content-host info having blank "Release Version" every time
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: HammerAssignee: Adam Price <adprice>
Status: CLOSED ERRATA QA Contact: sthirugn <sthirugn>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.8CC: bbuckingham, bkearney, cwelton, jcallaha, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
URL: http://projects.theforeman.org/issues/9666
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:00:03 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 Pavel Moravec 2015-03-05 14:01:11 UTC
Description of problem:
hammer content-host info outputs "Release Version:" as not set / empty every time, regardless of the release version set.


Version-Release number of selected component (if applicable):
rubygem-hammer_cli_katello-0.0.4-14.el6sat.noarch
rubygem-hammer_cli_foreman-0.1.1-16.el6sat.noarch
rubygem-hammer_cli_import-0.10.4-1.3.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
rubygem-hammer_cli-0.1.1-12.el6sat.noarch


How reproducible:
100%


Steps to Reproduce:
1. Have some content host
2. Set a release version (e.g. to 7Server) to the host via Web UI
3. run hammer shell and check release version:
content-host info --name=<name> --organization=<org>

4. Set a different release version via hammer:
content-host update --name=<name> --organization=<org> --release-ver=7.0

5. check release version again:
content-host info --name=<name> --organization=<org>


Actual results:
Steps 3. and 5. shows: "Release Version:         "


Expected results:
Step 3. to show "Release Version:         7Server"
Step 5. to show "Release Version:         7.0"


Additional info:
Enabling hammer debugs, I see that hammer gets response to GET request with proper "release_ver" => "7Server", or "release_ver" => "7.0". So the bug lies inside hammer.

Comment 2 Pavel Moravec 2015-03-06 14:04:05 UTC
Upstream PR:

https://github.com/Katello/hammer-cli-katello/pull/283

Comment 3 Tom McKay 2015-03-06 14:14:36 UTC
Created redmine issue http://projects.theforeman.org/issues/9666 from this bug

Comment 4 Bryan Kearney 2015-03-06 17:05:40 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9666 has been closed
-------------
Anonymous
Applied in changeset commit:hammer-cli-katello|f4d85a9cd96a398bec1e1081ad025b2526ad536f.

Comment 5 jcallaha 2015-03-12 19:55:43 UTC
Failed QA
Satellite 6.1.0 snap 6.

Version tested:
RHEL 66
RHEL 71 

hammer> content-host update --release-ver=7.0 --name=qe-blade-08.idmqe.lab.eng.bos.redhat.com --organization-id=323
Content host updated
hammer> content-host info --name=qe-blade-08.idmqe.lab.eng.bos.redhat.com --organization-id=323
Name:                    qe-blade-08.idmqe.lab.eng.bos.redhat.com
ID:                      8ffd05f5-6e79-4741-9e02-fbfc23f46b3e
Katello Agent Installed: no
Description:             Initial Registration Params
Location:                None
Lifecycle Environment:   Library
Content View:            rhel7
Entitlement Status:      partial
Release Version:         
Autoheal:                true
Security Errata:         0
Bugfix Errata:           0
Enhancement Errata:      0

Comment 6 Pavel Moravec 2015-03-12 20:33:05 UTC
(In reply to jcallaha from comment #5)
> Failed QA
> Satellite 6.1.0 snap 6.
> 
> Version tested:
> RHEL 66
> RHEL 71 
> 
> hammer> content-host update --release-ver=7.0
> --name=qe-blade-08.idmqe.lab.eng.bos.redhat.com --organization-id=323
> Content host updated
> hammer> content-host info --name=qe-blade-08.idmqe.lab.eng.bos.redhat.com
> --organization-id=323
> Name:                    qe-blade-08.idmqe.lab.eng.bos.redhat.com
> ID:                      8ffd05f5-6e79-4741-9e02-fbfc23f46b3e
> Katello Agent Installed: no
> Description:             Initial Registration Params
> Location:                None
> Lifecycle Environment:   Library
> Content View:            rhel7
> Entitlement Status:      partial
> Release Version:         
> Autoheal:                true
> Security Errata:         0
> Bugfix Errata:           0
> Enhancement Errata:      0

Would it be possible to get credentials to that sat6 machine where I could run few tests (like follow reproducer, fiddle with hammer .rb sources, enable hammer debugs)? I can restrict my activity to NA night time, if desired.

Comment 7 Adam Price 2015-03-18 21:04:41 UTC
Pavel,

I am unable to reproduce this bug upstream, I'll try with Satellite6 next.

In the meantime, if you want more out from hammer, run the commands with the global --verbose and --debug flags like so:

hammer --verbose --debug content-host info --organization acme --name host1

Comment 8 jcallaha 2015-09-01 19:35:42 UTC
Recreated in Satellite 6.1.1 27 Aug Build

hammer> content-host update --release-ver=7.0 --name=ibm-x3550m3-07.lab.eng.brq.redhat.com --organization-id=1
Content host updated
hammer> content-host info --name=ibm-x3550m3-07.lab.eng.brq.redhat.com --organization-id=1
Name:                    ibm-x3550m3-07.lab.eng.brq.redhat.com
ID:                      ce0f9286-2240-423a-8a51-d3df14ad7e52
Katello Agent Installed: no
Description:             Initial Registration Params
Location:                None
Lifecycle Environment:   Dev
Content View:            testview
Entitlement Status:      valid
Release Version:         
Autoheal:                true
Security Errata:         0
Bugfix Errata:           0
Enhancement Errata:      0

The satellite is rhsm-qe-1.rhq.lab.eng.bos.redhat.com. Please ping me on irc (jcallaha) for credentials.

Comment 9 Pavel Moravec 2015-09-02 14:04:34 UTC
I can confirm the bug is _not_ fixed. As the upstream fix:

https://github.com/Katello/hammer-cli-katello/pull/283/files

is not backported / cherry-picked properly:

# grep Release /usr/share/gems/gems/hammer_cli_katello-0.0.7.17/lib/hammer_cli_katello/content_host.rb
        field :releaseVer, _("Release Version")
# rpm -qf /usr/share/gems/gems/hammer_cli_katello-0.0.7.17/lib/hammer_cli_katello/content_host.rb
rubygem-hammer_cli_katello-0.0.7.17-1.el7sat.noarch
#

Comment 10 jcallaha 2016-03-17 14:01:58 UTC
testing blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1318686

Comment 12 sthirugn@redhat.com 2016-04-07 21:10:49 UTC
Verified in satellite-6.2.0-6.2.beta.el7sat.noarch

Before release version update:

hammer> content-host info --name=$host --organization='Default Organization'
Name:                    $host
ID:                      5fd99b91-12d2-4d5d-9598-c6a85e809c99
Katello Agent Installed: yes
Description:             
Location:                None
Lifecycle Environment:   QE
Content View:            rhel7cv
Entitlement Status:      valid
Release Version:         
Autoheal:                true
Security Errata:         27
Bugfix Errata:           32
Enhancement Errata:      4


After release version update:

hammer> content-host info --name=$host --organization='Default Organization'
Name:                    $host
ID:                      5fd99b91-12d2-4d5d-9598-c6a85e809c99
Katello Agent Installed: yes
Description:             
Location:                None
Lifecycle Environment:   QE
Content View:            rhel7cv
Entitlement Status:      valid
Release Version:         7Server
Autoheal:                false
Security Errata:         27
Bugfix Errata:           32
Enhancement Errata:      4

Comment 14 Bryan Kearney 2016-07-27 11:00:03 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/RHBA-2016:1501