Bug #1789
closed
Parent hostgroup name is truncated when its sub-group is a sub-string of the parent hostgroup name
Added by Rami Vaknin over 12 years ago.
Updated over 12 years ago.
Description
The name of a hostgroup is truncated in case the sub-hostgroup is a substring of its parent name: when "mi" group is created under "Rami" group - it looks like: "Ra/mi" instead of "Rami/mi"
Version:
foreman-1.0.0-1.el6.noarch
Files
- Status changed from New to Feedback
I just spent a little while digging into this. This problem occurs in
app/helpers/hosts_and_hostgroups_helper.rb
on line 5. The gsub method gets called on group.to_s, which is a complete string of the child hostgroup and all of its parents if there are any. Therefore, the name of the current group (group.name) without parents replaces all the instances of itself in group.to_s. The gsub should only get called on the substring after the last backslash (i.e. on "test", not "test/test").
I've spent enough time on this for today without a quick fix, so I'm going to move on, but I will revisit this later.
- Status changed from Feedback to Pending
- Category changed from Dashboard to Web Interface
- Assignee set to Sam Kottler
- Target version set to 1.1
- Status changed from Pending to Closed
- % Done changed from 0 to 100
- Target version changed from 1.1 to 1.0.1
Also available in: Atom
PDF