Bug 1119208 - 'type' field in Katello::System incorrectly triggers STI for Host::Managed
Summary: 'type' field in Katello::System incorrectly triggers STI for Host::Managed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: jmagen@redhat.com
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-14 09:30 UTC by jmagen@redhat.com
Modified: 2019-09-26 13:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:25:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6596 0 None None None 2016-04-22 16:05:21 UTC

Description jmagen@redhat.com 2014-07-14 09:30:11 UTC
Description of problem:

if the type of Katello::System instance is 'Host', then when working the rails console, the class type returns Host::Managed when it should return Katello::System

> a = Katello::System.first
> a.class
=> Host::Managed
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. rails console
2. find content host of type 'Host'
3. check .class on instance

Actual results:
=> Host::Managed


Expected results:
=> Katello::System

Additional info:

Comment 1 RHEL Program Management 2014-07-14 09:54:24 UTC
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.

Comment 3 jmagen@redhat.com 2014-07-14 14:21:07 UTC
I thought there was a bug with type, but it appears to be caused by the Hirb gem which Foreman loads in the rails console to prettify the output
Notice that type='Host' with pretty Hirb results and type='Katello::System" without.


1.9.3-p547 :002 > Katello::System.first
  Katello::System Load (0.7ms)  SELECT "katello_systems".* FROM "katello_systems" LIMIT 1
+----+-----------------------+-----------------------+-----------------------+----------+----------------+-----------------------+-----------------------+------+-----------------+---------+
| id | uuid                  | name                  | description           | location | environment_id | created_at            | updated_at            | type | content_view_id | host_id |
+----+-----------------------+-----------------------+-----------------------+----------+----------------+-----------------------+-----------------------+------+-----------------+---------+
| 33 | cecfeafb-b378-440c... | dhcp-8-30-82.lab.e... | Initial Registrati... | None     | 2              | 2014-06-25 19:49:2... | 2014-06-25 19:49:2... | Host | 2               |         |
+----+-----------------------+-----------------------+-----------------------+----------+----------------+-----------------------+-----------------------+------+-----------------+---------+


1.9.3-p547 :007 > Hirb.disable
 => false 


1.9.3-p547 :008 > Katello::System.first
 => #<Katello::System id: 33, uuid: "cecfeafb-b378-440c-9352-b40881b8c6f5", name: "dhcp-8-30-82.lab.eng.rdu2.redhat.com", description: "Initial Registration Params", location: "None", environment_id: 2, created_at: "2014-06-25 19:49:20", updated_at: "2014-06-25 19:49:22", type: "Katello::System", content_view_id: 2, host_id: nil>

Comment 4 Bryan Kearney 2014-07-23 14:04:25 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6596 has been closed
-------------
Joseph Magen
Applied in changeset commit:katello|19b8185e435b4d2b0df8e430bec33f98be8242bf.

Comment 6 Bryan Kearney 2014-09-11 12:25:25 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.


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