Issue #12402 has been updated by Michael Warren.

This seems to do the right thing.  I've never contributed to Puppet before so 
I'm not sure the right way to get this to you, but here is a unified diff:

<pre>
--- content.rb  2012-02-03 13:35:37.413733627 -0800
+++ /var/lib/gems/1.8/gems/puppet-2.7.10//lib/puppet/type/file/content.rb       
2012-02-03 13:39:29.614116841 -0800
@@ -104,7 +104,10 @@
 
       if ! result and Puppet[:show_diff]
         write_temporarily do |path|
-          notice "\n" + diff(@resource[:path], path)
+          notice ""
+          diff(@resource[:path], path).split("\n").each do |line|
+            Puppet.notice line
+          end
         end
       end
       result
</pre>
----------------------------------------
Bug #12402: Puppet should include process/PID name when sending diff output to 
syslog.
https://projects.puppetlabs.com/issues/12402

Author: Michael Warren
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: puppet, syslog, diff, process, name, pid
Branch: 


Currently for most output while running the puppet agent, the syslog output 
looks like this for most messages:

<pre>
<daemon.info> Feb  2 18:18:55 mvvm1b puppet-agent[4855]: Retrieving plugin
<daemon.info> Feb  2 18:18:59 mvvm1b puppet-agent[4855]: Caching catalog for 
labmaster
<daemon.info> Feb  2 18:19:00 mvvm1b puppet-agent[4855]: Applying configuration 
version '1328234004'
</pre>

However, when puppet sends diff output to syslog, it doesn't include the 
"process-name[pid]" portion:

<pre>
<user.notice> Feb  2 17:53:28 mvvm1b --- 
/var/lib/puppet/state/last_run_summary.yaml    2012-02-02 17:53:03.801239692 
-0800
<user.notice> Feb  2 17:53:28 mvvm1b +++ 
/tmp/puppet-file20120202-4021-1fy9x5j-0        2012-02-02 17:53:27.970439343 
-0800
<user.notice> Feb  2 17:53:28 mvvm1b @@ -1,31 +1,31 @@
<user.notice> Feb  2 17:53:28 mvvm1b --- 
<user.notice> Feb  2 17:53:28 mvvm1b time: 
<user.notice> Feb  2 17:53:28 mvvm1b -    group: 0.000644
<user.notice> Feb  2 17:53:28 mvvm1b -    last_run: 1328233983
</pre>

This causes problems with parsing syslog messages because without the process 
name, a parser thinks that the process name is "---", "+++", "@@", etc.

Would it be possible to include the process name and PID in diff messages sent 
to syslog so the above would look like this:

<pre>
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: --- 
/var/lib/puppet/state/last_run_summary.yaml    2012-02-02 17:53:03.801239692 
-0800
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: +++ 
/tmp/puppet-file20120202-4021-1fy9x5j-0        2012-02-02 17:53:27.970439343 
-0800
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: @@ -1,31 +1,31 @@
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: --- 
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: time: 
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: -    group: 0.000644
<user.notice> Feb  2 17:53:28 mvvm1b puppet-agent[4855]: -    last_run: 
1328233983
</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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to