Project

General

Profile

Bug #33054

Inheritance does not work for child hostgroups Content view, Content Source and Lifecycle environment

Added by Yunus Tatli 10 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

When creating a new child host group, all fields except Content view, Lifecycle environment and Content Source are taken as “inherent Paren(Name-of-Content)”. In the corresponding fields, the three are taken as actual names insteed of for examle as lifecycle environment “inherent Parent(production)” .

If you choose the right entries and enable inheritance and get the host group with the following API command, you will not get “Contentview_id” in the output or you will get “Null”:

[ ~]# curl --insecure --connect-timeout 180 --silent --user admin:atix --header 'Accept:application/json,version=2;charset=utf-8' --header Content-Type:application/json -X GET [https://foreman-server.local.yt/api/hostgroups/39]

Steps to Reproduce the problem:

Create a child hostgroup and select parent hostgroup.
All fields of the parent host group will be taken over but instead of “inherit Parent (Name-of-Content view)” directly “Name-of-Content view” will be taken.
Same as above for content source and lifecycle environment.

Actual results:

All fields of the parent host group will be taken over but instead of “inherit Parent (Name-of-Content view)”, directly “Name-of-Content view” will be taken. The issue is the same for content source and lifecycle environment.

Furthermore, if you select “inherit Parent (Name-of-Content view)” under Content view, it is not inherited.

If you call the following api command:

[ ~]# curl --insecure --connect-timeout 180 --silent --user User:Passwd --header 'Accept:application/json,version=2;charset=utf-8' --header Content-Type:application/json -X GET [https://foreman-server.local.yt/api/hostgroups/39]

{"content_source_id":1,"content_source_name":"foreman-server.local.yt","content_view_id":null,"content_view_name":"Examle-content-view","lifecycle_environment_id":1,"lifecycle_environment_name":"Examle-Environment","kickstart_repository_id":null,"kickstart_repository_name":null,"subnet_id":null,"subnet_name":"OR-network","operatingsystem_id":null,"operatingsystem_name":"CentOS 8.X","domain_id":null,"domain_name":"local.yt","environment_id":null,"environment_name":"examle-environment","compute_profile_id":null,"compute_profile_name":"1-Small","ancestry":"2","parent_id":2,"parent_name":"Examle-hostgroup Library","ptable_id":null,"ptable_name":"Kickstart default","medium_id":null,"medium_name":"Examle-Installation-madia-name","pxe_loader":"PXELinux BIOS","subnet6_id":null,"subnet6_name":null,"compute_resource_id":null,"compute_resource_name":"VMWareSUPPORT2","architecture_id":null,"architecture_name":"x86_64","realm_id":null,"realm_name":null,"created_at":"2021-05-25 14:06:00 UTC","updated_at":"2021-05-25 14:07:47 UTC","id":39,"name":"Examle-hostgroup-test-child","title":"Examle-Parent-hostgroup/Examle-hostgroup-test-child","description":"","puppet_proxy_id":null,"puppet_proxy_name":"foreman-server.local.yt","puppet_ca_proxy_id":null,"puppet_ca_proxy_name":"foreman-server.local.yt","openscap_proxy_id":null,"openscap_proxy_name":"foreman-server.local.yt","puppet_proxy":\\{"name":"foreman-server.local.yt","id":1,"url":"https://foreman-server.local.yt:xxxx"}

Expected results:

If you select “inherit Parent (Name-of-Content view)” under Content view, it should take over. The issue is the same for content source and lifecycle environment.

foreman-2.3.3-58009.noarch
foreman-cli-2.3.3-58009.noarch
foreman-proxy-2.3.4-1.el7.noarch

Associated revisions

Revision 0863618b (diff)
Added by Partha Aji 8 months ago

Fixes #33385,#33054,#33144 - Fixes host group inheritance (#9599)

Before the PR -

On create hostgroups page the inheritance hierachy behavior was different
between katello attribute like content_view/lce/content source etc vs
things like os and arch
For example if you create a child hostgroup and ppointed to a parent
with contnet view, you would see the cv automatically selected as the
default, instead of 'Inherit Content View' as os/arch fields behave.

More over if you had cv, lce, cs, arch filled in the parent hostgroup
and enabled operating system in the child the media section would not
get automatically populated (because the notion of parent_id was
missing)

After:

Both the above cases behave appropriately.

History

#1 Updated by Yunus Tatli 10 months ago

  • Description updated (diff)

#2 Updated by Bernhard Suttner 10 months ago

  • Category deleted (Host groups)
  • Project changed from Foreman to Katello

#3 Updated by Bernhard Suttner 10 months ago

  • Found in Releases Katello 3.18.3 added
  • Found in Releases deleted (2.3.3)

#4 Updated by Ian Ballou 10 months ago

  • Triaged changed from No to Yes
  • Target version set to Katello 4.3.0

#5 Updated by The Foreman Bot 9 months ago

  • Assignee set to Partha Aji
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/9599 added

#6 Updated by The Foreman Bot 8 months ago

  • Fixed in Releases Katello 4.3.0 added

#7 Updated by Partha Aji 8 months ago

  • Status changed from Ready For Testing to Closed

#8 Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/Katello/katello/pull/9656 added

Also available in: Atom PDF