theforeman/foreman — pull request #924 by eLobato (2013-10-02 14:50:56+00:00)
Title: Bug #2231: Hostgroup deletion follows :restrict orphan policy

Given a hostgroup hierarchy like:

/base
/base/test01
/base/test01/test02
/base/test01/test03

Currently, if /base/test01 is deleted, it leads to a clunky configuration

/base
/test02
/test03

In addition to that, it might lead to having several hostgroups with the same name:

/base
/test/base

If test is deleted, we would end up with

/base
/base

This change restricts hostgroup deletion only to hostgroups who have no children so that the problems above can be avoided.

http://projects.theforeman.org/issues/2231