Using dots in kickstart template names or hostgroups causes routing errors
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):
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
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");
A rendered kickstart
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.
fixes #5826 - Using dots in kickstart template names or hostgroups causes routing errors