Project

General

Profile

Actions

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 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Low
Assignee:
Sam Kottler
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

foreman.png View foreman.png 2.78 KB Screenshot Rami Vaknin, 07/29/2012 04:54 AM
Actions #1

Updated by Sam Kottler over 11 years ago

  • 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.

Actions #2

Updated by Sam Kottler over 11 years ago

  • Status changed from Feedback to Pending
Actions #3

Updated by Ohad Levy over 11 years ago

  • Category changed from Dashboard to Web Interface
  • Assignee set to Sam Kottler
  • Target version set to 1.1
Actions #4

Updated by Anonymous over 11 years ago

  • Status changed from Pending to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Ohad Levy over 11 years ago

  • Target version changed from 1.1 to 1.0.1
Actions

Also available in: Atom PDF