Issue #21896 has been updated by Michael Rollins.

Assignee changed from Michael Rollins to Peter Meier

Following the steps you provided, we are not able to reproduce the problem.  
Doing further testing, it appears we may have run into a problem with the 
template's code being interpreted unexpectantly.  Using a test case, I was 
unable to replicate the exact behavior we had experienced previously where the 
lines were not being updated at all.  

Although expanding your test example to our specific case, we can see where the 
open tag is not being replaced with _blank_ in the second line with a "<%".

<pre>
/tmp$ vim bar.pp

file{'/tmp/a':
  content => template('/tmp/templates/test1.erb')
}

/tmp$ cat templates/test1.erb

        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.Screen.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} %p %m%n
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} %p %m%n
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout

/tmp$ puppet apply bar.pp
notice: /Stage[main]//File[/tmp/a]/content: content changed 
'{md5}106719ba70889261ddae53fd937a4ac7' to 
'{md5}af897f26d21778dca4e81d71aadb6701'
notice: Finished catalog run in 0.04 seconds

/tmp$ cat a
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.Screen.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} %p %m%n
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} %p %m%n
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout

/tmp$ cat templates/test2.erb

        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.Screen.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} <%p> %m%n
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} <%p> %m%n
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout

/tmp$ cat bar.pp

file{'/tmp/b':
  content => template('/tmp/templates/test2.erb')
}

/tmp$ puppet apply bar.pp
notice: /Stage[main]//File[/tmp/b]/content: content changed 
'{md5}106719ba70889261ddae53fd937a4ac7' to 
'{md5}e0def2d1d6ab42bc49a631268a043aae'
notice: Finished catalog run in 0.03 seconds

/tmp$ cat b
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.Screen.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} p> %m%n
        log4perl.appender.Screen            = Log::Log4perl::Appender::Screen
        log4perl.appender.Screen.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout
        log4perl.appender.mrlog.layout.ConversionPattern = %d{yyyy-MM-dd 
HH:mm:ss} <%p> %m%n
        log4perl.appender.mrlog            = Log::Log4perl::Appender::mrlog
        log4perl.appender.mrlog.layout     = 
Log::Log4perl::Layout::PatternLayout

</pre>

----------------------------------------
Bug #21896: Open ERB tag in file template prevents updates and causes no error 
output
https://projects.puppetlabs.com/issues/21896#change-95280

* Author: Michael Rollins
* Status: Needs More Information
* Priority: Normal
* Assignee: Peter Meier
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
In a file template there was the following code:
<pre>
log4perl.appender.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} <%p> %m%n
</pre>

Any updates to this line were ignored by puppet agent runs, despite the file 
having different MD5 sums.  Updates to other lines were processed and pushed 
normally.

It was determined that the open ERB tag was the culprit "<%", and after 
removing this the problem went away.  The code after the open tag did parse as 
ERB code without errors.  This is not a bug with parsing ERB code.

The reason for submitting this bug is because puppet did not throw any 
exceptions, warnings, or errors when parsing the file, nor during subsequent 
agent runs. Puppet did not push updates to the file when they were made 
however, which caused much concern.  The logs did not contain any information 
that was helpful for troubleshooting this issue.

<bold>If puppet determines the checksum of a file is different, but does not 
apply changes to allow the checksums to match, then it should generate a 
warning or error indicating that a file was not able to be updated.</bold>

<pre>
ruby 1.8.6 (2010-02-05 patchlevel 399) [x86_64-linux]
2.6.18-238.19.1.el5 (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50))
puppet = 2.7.19
</pre>






-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to