Project

General

Profile

Actions

Bug #35732

open

new locations force hostgroups and provisioning templates to be in the ignore_types list breaking user workflows

Added by Evgeni Golov over 2 years ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Ohai,

while working on https://github.com/theforeman/foreman-ansible-modules/pull/1509 with Manisha, we realized there is an interesting behaviour in Katello that is not intuitive to users.

When you create a new location, katello forces the "ignore_types" attribute to include hostgroups and provisioning templates: https://github.com/Katello/katello/blob/c6488ec90d08569368137c4a365b1a384824a34b/app/models/katello/concerns/location_extensions.rb#L13-L16
This was added back in 2014: https://github.com/Katello/katello/pull/4399

This has two effects, both of which are IMHO undesired:
  1. When one creates a location via the API and explicitly set ignore_types: [] or ignore_types: ["Subnet"], one still gets the parameter set to ["Subnet", "Hostgroup", "ProvisioningTemplate"] (and if the API client is Ansible, the next execution of the playbook will correct that to be ["Subnet"] while one would expect no-change)
  2. When the location is created and all Hostgroups/Templates are added to it, the user needs to first remove HG/PT from the ignore_types list, and then remove all HGs/PTs they did not want to be assigned in the first place.

At least for the API case the solution is probably easy: if the user has provided ignore_types (either as an empty list or a list with explicit values) don't amend their selection at all.

No idea how to "fix" that in the UI given the creation workflow is totally different there.

Actions

Also available in: Atom PDF