Bug 1620606 - "Parameters" are missing from the GET hostgroup api output
Summary: "Parameters" are missing from the GET hostgroup api output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Host Group
Version: 6.4
Hardware: x86_64
OS: Linux
high
high vote
Target Milestone: 6.4.0
Assignee: Kavita
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks: 1619394
TreeView+ depends on / blocked
 
Reported: 2018-08-23 10:00 UTC by Mihir Lele
Modified: 2019-11-05 23:33 UTC (History)
5 users (show)

Fixed In Version: foreman-1.18.0.19-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:05:48 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 24735 None None None 2018-08-28 18:45:53 UTC

Description Mihir Lele 2018-08-23 10:00:04 UTC
Description of problem:

"Parameters" are missing from the GET hostgroup api output

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

How reproducible: Always


Steps to Reproduce:
1. Compare the output of the below command from sat 6.3 and sat 6.4. (Make sure that the hostgroup has some parameters like activation key on it)

# curl -s -u admin:redhat -k https://satellite.example.com/api/v2/hostgroups/1 | json_reformat

Actual results:

GET request does not provide the parameters added on a hostgroup.

Expected results:

GET request should provide the parameters added on a hostgroup.

Additional info:

Adding diff output from 6.3 and 6.4:

--------------------

[root@satellite ~]# diff -u /tmp/6_3 /tmp/6_4
--- /tmp/6_3	2018-08-22 12:50:16.083218432 -0400
+++ /tmp/6_4	2018-08-22 12:49:54.554759338 -0400
@@ -6,10 +6,11 @@
     "lifecycle_environment_id": 1,
     "lifecycle_environment_name": "Library",
     "kickstart_repository_id": 7,
+    "kickstart_repository_name": "Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.5",
     "subnet_id": 1,
     "subnet_name": "subnet1",
     "operatingsystem_id": 2,
-    "operatingsystem_name": "RedHat 7.5",
+    "operatingsystem_name": "RHEL Server 7.5",
     "domain_id": 1,
     "domain_name": "example.com",
     "environment_id": 4,
@@ -24,15 +25,18 @@
     "medium_id": null,
     "medium_name": null,
     "pxe_loader": null,
+    "subnet6_id": null,
+    "subnet6_name": null,
     "architecture_id": 1,
     "architecture_name": "x86_64",
     "realm_id": null,
     "realm_name": null,
     "created_at": "2018-06-07 11:30:02 UTC",
-    "updated_at": "2018-08-22 16:43:13 UTC",
+    "updated_at": "2018-08-22 16:49:21 UTC",
     "id": 1,
     "name": "hostgroup",
     "title": "hostgroup",
+    "description": "",
     "puppet_proxy_id": 1,
     "puppet_proxy_name": "satellite.example.com",
     "puppet_ca_proxy_id": 1,
@@ -68,16 +72,6 @@
     "config_groups": [
 
     ],
-    "parameters": [
-        {
-            "priority": 4,
-            "created_at": "2018-06-07 11:31:14 UTC",
-            "updated_at": "2018-06-07 11:31:14 UTC",
-            "id": 1,
-            "name": "kt_activation_keys",
-            "value": "act"
-        }
-    ],
     "all_puppetclasses": [
         {
             "id": 5,

-----------------


Customer has proposed the below patch to fix the above issue:

=======================

# diff -u /usr/share/foreman/app/views/api/v2/hostgroups/show.json.rabl.180822-1 /usr/share/foreman/app/views/api/v2/hostgroups/show.json.rabl
--- /usr/share/foreman/app/views/api/v2/hostgroups/show.json.rabl.180822-1      2018-07-27 17:34:29.000000000 +0000
+++ /usr/share/foreman/app/views/api/v2/hostgroups/show.json.rabl       2018-08-22 11:21:16.122451498 +0000
@@ -2,6 +2,10 @@

 extends "api/v2/hostgroups/main"

+child :group_parameters => :parameters do
+  extends "api/v2/parameters/base"
+end
+
 child :template_combinations do
   extends "api/v2/template_combinations/base"
 end

========================

Comment 1 Peter Vreman 2018-08-23 11:44:31 UTC
This is an undocumented change that breaks API backwards compatibility.
If changes are made then deprecation time should be given to allow the API users.

For me this is a Showstopper to migrate to Sat6.4 in the future because my Updater scripts relies on this field on the clients code to extact the ActivitionKey. When not found ti aborts. This then ofcourse also prevents the rollout of updated client code.

Therefor the Sat6.4 should introduce a deprecation time to give me time to rollout the change. And as we are Entreprise and require testing and waiting at various tiers (=lifecycle environments) such Rollouts to clients can take easily 6+ months until it is on all servers.

peter

Comment 5 Kavita 2018-08-28 18:45:49 UTC
Created redmine issue http://projects.theforeman.org/issues/24735 from this bug

Comment 6 pm-sat@redhat.com 2018-09-02 00:10:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24735 has been resolved.

Comment 8 Sanket Jagtap 2018-09-11 11:40:18 UTC
Build: Satellite 6.4.0 snap21

curl -s -u admin:changeme -X GET -H "Content-type: application/json" -H "Accept: application/json" -k https://sat-host/api/v2/hostgroups/2 | json_reformat


 "parameters": [
        {
            "priority": 60,
            "created_at": "2018-09-11 08:33:17 UTC",
            "updated_at": "2018-09-11 10:44:49 UTC",
            "id": 4,
            "name": "kt_activation_keys",
            "value": "ak-rhel-7"
        },
        {
            "priority": 60,
            "created_at": "2018-09-11 10:44:49 UTC",
            "updated_at": "2018-09-11 10:44:49 UTC",
            "id": 7,
            "name": "ssh-key",
            "value": "False"
        }
    ],
    "template_combinations": [

    ],
    "puppetclasses": [
        {
            "id": 1,
            "name": "access_insights_client",
            "module_name": "access_insights_client"
        },
        {
            "id": 2,
            "name": "foreman_scap_client",
            "module_name": "foreman_scap_client"
        }
    ],

Comment 9 Bryan Kearney 2018-10-16 19:05:48 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:2927


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