Bug #5826

Using dots in kickstart template names or hostgroups causes routing errors

Added by Dominic Cleal over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Joseph Magen
Category:Templates
Target version:Sprint 24
Difficulty: Bugzilla link:1098183
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.1Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1098183
Description of problem:
Using dots in the names of kickstart templates or host groups results in problematic kickstart URLs in the default PXE configuration.

Version-Release number of selected component (if applicable):
6.03

How reproducible:
Always

Steps to Reproduce:
1. Create a host group with a dot in the name
2. Create a kickstart with a dot in the name (NB we do not need dots in both the kickstart and host group name - either will cause a failure)
3. Associate the kickstart with the host group
4. Generate the PXE default menu by clicking the 'Build PXE Default' button
5. Go to /var/lib/tftpboot/pxelinux.cfg on the smartproxy and open the default file.
6. Paste the kickstart URL e.g. https://<servername>/foreman/unattended/template/testkickstart.1/test-1 into a browser window

Actual results:
A web message saying 'The page you were looking for doesn't exist'.

In production.log, we see:

ActionController::RoutingError (No route matches [GET] "/unattended/template/testkickstart.1/test-1");

Expected results:
A rendered kickstart

Additional info:
This error occurs because the default Rails configuration uses dots as a separator for formatted routes, so doesn't accept them as part of dynamic segments.

A few suggested workaround:

1. Permit the use of dots in segments for the unattended controller.
2. Add contstraints to the UI to reject any template names or host group names containing dots as illegal.
3. Transparently map dots to underscores in the application.

Associated revisions

Revision 1db7e820
Added by Joseph Magen over 3 years ago

fixes #5826 - Using dots in kickstart template names or hostgroups causes routing errors

Revision a9456e8a
Added by Joseph Magen over 3 years ago

fixes #5826 - Using dots in kickstart template names or hostgroups causes routing errors

(cherry picked from commit 1db7e82036351e8b1118148b55a07ec8bbcd0b2b)

History

#1 Updated by Dominic Cleal over 3 years ago

  • Category set to Templates

#2 Updated by Joseph Magen over 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Joseph Magen
  • Target version set to Sprint 24

#3 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.1

#4 Updated by Joseph Magen over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF