Bug #2527
closedWindows newlines not stripped from disk templates with hostgroup template rendering
Description
When using hostgroup based template rendering, Windows style newlines are not correctly stripped out of partition table layouts. This issue does not appear to affect standard host based rendering, with or without spoofing.
Foreman version: 1.1
Foreman Host OS: SL6.2
Steps to reproduce:
- Create a test dynamic partitioning layout using the foreman WebUI
- Create a test provisioning template, using the above dynamic layout
- Assign the template and disk layout to a test hostgroup.
- Download the layout using hostgroup based template rendering. E.g.
http://foreman.example.com/unattended/template/AAA_test/test
Result: Windows newlines mixed into output. See attached example of good and bad output.
The results seem most obvious editing the file with vi. A simple cat will not show the extra control characters.
Discussing this with Ohad:
[05:04] <ohadlevy> cbarbour: code say that we always strip \r from the disk layout string
[05:04] <ohadlevy> cbarbour: how are you calling your disk layout in kickstart?
[05:04] <ohadlevy> cbarbour: @host.diskLayout
[05:04] <ohadlevy> cbarbour: i'm guessing you are simply doing @host.disk ?
[05:04] <ohadlevy> cbarbour: we strip it out when we fetch the data, not on insert afair
[05:04] <cbarbour> That's how I'm calling it.
[05:05] <cbarbour> The only weird thing I'm doing is using hostgroup based rendering.
[05:26] <cbarbour> To be clear... I'm calling the layout with @host.diskLayout.
[05:27] <cbarbour> Problem only appears when using hostgroup template rendering. Everything looks normal otherwise.
Files