Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1353968 - Satellite 6: Smart Variables still removing newlines (http://projects.theforeman.org/issues/15534)
Satellite 6: Smart Variables still removing newlines (http://projects.thefore...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Provisioning (Show other bugs)
6.1.9
x86_64 Linux
unspecified Severity medium (vote)
: 6.2.9
: Unused
Assigned To: Tomer Brisker
Bruno Rocha
: Triaged
Depends On:
Blocks: 1415680 1426384
  Show dependency treegraph
 
Reported: 2016-07-08 10:43 EDT by Calvin Hartwell
Modified: 2017-05-01 09:53 EDT (History)
9 users (show)

See Also:
Fixed In Version: foreman-1.11.0.72-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426384 (view as bug list)
Environment:
Last Closed: 2017-05-01 09:53:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 15534 None None None 2016-07-08 11:37 EDT
Red Hat Product Errata RHBA-2017:1191 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 13:49:42 EDT

  None (edit)
Description Calvin Hartwell 2016-07-08 10:43:24 EDT
Description of problem:

The smart variables/parameters remove new lines (and white space) which causes issues with the motd module (discussed and fixed here: http://projects.theforeman.org/issues/15534). 

I've seen multiple customers with this issue. I've also seen multiple red hat employees describe this issue in the #satellite6 channel. 

We need a backward port of this fix fr 6.1.9. We also need this fix in 6.2.0. 

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

6.1.X
6.1.9
6.2.X

How reproducible:

Easy to reproduce. 

Steps to Reproduce:
1. Install and setup sat6. 
2. Add the motd module from the puppet forge (by puppet labs). 
3. Publish CV with Puppet module.
4. Add the puppet module to a hostgroup/host and configure the content parameter for the module. Try to add a newline character (either \n or "\n") but it will be removed from the parameter. 

Actual results:

motd from puppet forge (by puppet labs) puppet module does not work well with sat6. 

Expected results:

motd puppet module should work as expected. 
Smart variables/parameters should be able to handle new line characters.  

Additional info:

External bug: http://projects.theforeman.org/issues/15534
Comment 1 Bryan Kearney 2016-07-08 11:37:29 EDT
Connecting redmine issue http://projects.theforeman.org/issues/15534 from this bug
Comment 2 Calvin Hartwell 2016-07-08 12:09:52 EDT
(In reply to Bryan Kearney from comment #1)
> Connecting redmine issue http://projects.theforeman.org/issues/15534 from
> this bug

Thanks!
Comment 3 Bryan Kearney 2016-07-08 12:14:59 EDT
Upstream bug component is Provisioning
Comment 4 Bryan Kearney 2016-07-08 12:15:01 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/15534 has been closed
Comment 12 pm-sat@redhat.com 2017-02-23 16:08:45 EST
Please add verifications steps for this bug to help QE verify
Comment 13 Tomer Brisker 2017-02-26 03:06:01 EST
Verification steps:

1. Create a smart variable of type string on a puppet class, or use an existing smart parameter.
2. Set default value to something like:
"


Testing


"
3. Add a matcher that overrides the default value with a different value, e.g.:
"

Overridden

"
4. Save and reopen the parameter.
5. Observe that leading and trailing white space has not been removed in neither default value nor override value.
Comment 14 Bruno Rocha 2017-04-20 19:28:36 EDT
Verified in:



Results:

Work as expected, `content` parameter and `variable` accepting and keeping line breaks and trailing whitespaces

[root@cloud-qe-09 ~]# hammer sc-param info --id=22 
[Foreman] Password for admin: 
Id:              22
Parameter:       content
Default Value:   this should 
work with \n or "\n"
also with tabs
    this is a tab
\t should also work.
Override:        true
Puppet class:    motd
Description:     
Type:            string
Hidden Value?:   false
Required:        false
Validator:       
    Type: 
    Rule:
Override values: 
    Merge overrides:     no
    Merge default value: no
    Avoid duplicates:    no
    Order:               fqdn, hostgroup, os, domain
    Values:
Environments:    
    example_env
    KT_Default_Organization_Library_puppettest_125
Created at:      2017/04/20 17:14:13
Updated at:      2017/04/20 19:20:48



[root@cloud-qe-09 ~]# hammer smart-variable info --id=23
[Foreman] Password for admin: 
Id:              23
Name:            content
Default Value:   this should 
work with \n or "\n"
also with tabs
    this is a tab
\t should also work.
Type:            string
Puppet class:    motd
Description:     
Hidden Value?:   false
Validator:       
    Type: 
    Rule:
Override values: 
    Merge overrides:     no
    Merge default value: no
    Avoid duplicates:    no
    Order:               fqdn, hostgroup, os, domain
    Values:
Created at:      2017/04/20 19:13:59
Updated at:      2017/04/20 19:21:14
Comment 15 Bruno Rocha 2017-04-20 19:28:56 EDT
verified in: satellite-6.2.9-4.0.el7sat.noarch
Comment 16 Bruno Rocha 2017-04-20 19:33:53 EDT
Adding verification for comment 13



[root@cloud-qe-09 ~]# hammer smart-variable info --id=23
[Foreman] Password for admin: 
Id:              23
Name:            content
Default Value:   "


Testing


"
Type:            string
Puppet class:    motd
Description:     
Hidden Value?:   false
Validator:       
    Type: 
    Rule:
Override values: 
    Merge overrides:     no
    Merge default value: no
    Avoid duplicates:    no
    Order:               fqdn, hostgroup, os, domain
    Values:              
     1) Id:    1
        Match: domain=FQDN.com
        Value: "
        
        Overridden
        
        "
Created at:      2017/04/20 19:13:59
Updated at:      2017/04/20 19:32:41
Comment 18 errata-xmlrpc 2017-05-01 09:53:13 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1191

Note You need to log in before you can comment on or make changes to this bug.