Bug 1371900

Summary: API hosts and hostgroups missing puppet proxy names
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, brubisch, dlobatog, jcallaha, omaciel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1427192 (view as bug list) 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:
Bug Depends On:    
Bug Blocks: 1122832, 1427192    

Description Peter Vreman 2016-08-31 12:00:07 UTC
Description of problem:
The API of hsots and hostgroups returns for the puppet proxies the name fields. This is inconsistent with the other fields.




Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. GET hosts/1
2. GET hostgroups/1
3.

Actual results:
fields puppet_proxy_name and puppet_ca_proxy_name are not returned

Expected results:
fields puppet_proxy_name and puppet_ca_proxy_name are returned

Additional info:

Comment 1 Peter Vreman 2016-08-31 12:00:20 UTC
Patch:

[crash] root@li-lc-1578:/usr/share/foreman/app/views/api/v2# diff -u hosts/main.json.rabl.160831-1 hosts/main.json.rabl
--- hosts/main.json.rabl.160831-1       2016-08-09 22:10:52.000000000 +0000
+++ hosts/main.json.rabl        2016-08-31 10:52:19.247384039 +0000
@@ -14,7 +14,7 @@
            :enabled, :puppet_ca_proxy_id, :managed, :use_image, :image_file, :uuid, :compute_resource_id, :compute_resource_name,
            :compute_profile_id, :compute_profile_name, :capabilities, :provision_method,
            :puppet_proxy_id, :certname, :image_id, :image_name, :created_at, :updated_at,
-           :last_compile, :global_status, :global_status_label
+           :last_compile, :global_status, :global_status_label, :puppet_proxy_name, :puppet_ca_proxy_name
 attributes :organization_id, :organization_name if SETTINGS[:organizations_enabled]
 attributes :location_id, :location_name         if SETTINGS[:locations_enabled]

[crash] root@li-lc-1578:/usr/share/foreman/app/views/api/v2# diff -u hostgroups/main.json.rabl.160831-1 hostgroups/main.json.rabl                                                        --- hostgroups/main.json.rabl.160831-1  2016-08-09 22:10:52.000000000 +0000
+++ hostgroups/main.json.rabl   2016-08-31 11:56:37.617341709 +0000
@@ -5,4 +5,4 @@
 attributes :subnet_id, :subnet_name, :operatingsystem_id, :operatingsystem_name, :domain_id, :domain_name,
            :environment_id, :environment_name, :compute_profile_id, :compute_profile_name, :ancestry, :parent_id, :parent_name,
            :puppet_proxy_id, :puppet_ca_proxy_id, :ptable_id, :ptable_name, :medium_id, :medium_name,
-           :architecture_id, :architecture_name, :realm_id, :realm_name, :created_at, :updated_at
+           :architecture_id, :architecture_name, :realm_id, :realm_name, :created_at, :updated_at, :puppet_proxy_name, :puppet_ca_proxy_name

Comment 4 Brad Buckingham 2016-09-12 21:11:26 UTC
Created redmine issue http://projects.theforeman.org/issues/16525 from this bug

Comment 5 Brad Buckingham 2016-09-12 21:17:14 UTC
Thanks Peter for the patch!  I have submitted it upstream via foreman PR: 
  https://github.com/theforeman/foreman/pull/3835

Comment 6 Bryan Kearney 2016-09-13 08:18:29 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16525 has been resolved.

Comment 9 Stanislav Tkachenko 2017-02-27 14:50:22 UTC
Verified on Satellite 6.3 Snap 8.0 (satellite-6.3.0-11.1.beta.el7sat.noarch) but failed on latest available for QE 6.2.z build (Satellite 6.2.8 Snap 3.0, satellite-6.2.8-1.0.el7sat.noarch).

Marking this bug as Verified but will clone to track changes for 6.2.z

> Making HTTP GET request to https://sat6.com/api/v2/hosts/26 
> Received HTTP 200 response: { ..., "puppet_ca_proxy_id":1,"puppet_ca_proxy_name":"sat6.com","puppet_proxy_id":1,"puppet_proxy_name":"sat6.com", ... }}

> Making HTTP GET request to https://sat6.com/api/v2/hostgroups/25
> Received HTTP 200 response: { ..., "puppet_proxy_id":1,"puppet_proxy_name":"sat6.com","puppet_ca_proxy_id":1,"puppet_ca_proxy_name":"sat6.com", ...}

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