Project

General

Profile

Bug #1789

Parent hostgroup name is truncated when its sub-group is a sub-string of the parent hostgroup name

Added by Rami Vaknin over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Sam Kottler
Category:
Web Interface
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
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

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

Associated revisions

Revision 1c03cb48 (diff)
Added by Sam Kottler over 6 years ago

Fixes #1789 - Parent hostgroup name is truncated when its sub-group is a sub-string of the parent hostgroup name

Revision 6e92e9a5 (diff)
Added by Sam Kottler over 6 years ago

Fixes #1789 - Parent hostgroup name is truncated when its sub-group is a sub-string of the parent hostgroup name

History

#1 Updated by Sam Kottler over 6 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.

#2 Updated by Sam Kottler over 6 years ago

  • Status changed from Feedback to Pending

#3 Updated by Ohad Levy over 6 years ago

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

#4 Updated by Anonymous over 6 years ago

  • Status changed from Pending to Closed
  • % Done changed from 0 to 100

#5 Updated by Ohad Levy over 6 years ago

  • Target version changed from 1.1 to 1.0.1

Also available in: Atom PDF