Jira (PUP-2827) Incorrect return code for --noop

5 views
Skip to first unread message

Russell Mull (JIRA)

unread,
May 16, 2017, 2:42:03 PM5/16/17
to puppe...@googlegroups.com
Russell Mull updated an issue
 
Puppet / Bug PUP-2827
Incorrect return code for --noop
Change By: Russell Mull
Labels: triaged
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Russell Mull (JIRA)

unread,
May 16, 2017, 2:42:04 PM5/16/17
to puppe...@googlegroups.com
Russell Mull updated an issue
Change By: Russell Mull
Team: Agent

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:24 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: triaged

Josh Cooper (Jira)

unread,
May 7, 2020, 11:01:06 AM5/7/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-2827
 
Re: Incorrect return code for --noop

This is still reproducible. The problem is the configurer always tries to send the report and update its locally cached files, regardless of noop mode. It shouldn't do that. We had a similar bug where the cached catalog was being updated in noop mode.

$ puppet apply --noop t.pp --lastrunreport /dev/null
Notice: Compiled catalog for localhost in environment production in 0.01 seconds
Notice: Applied catalog in 0.02 seconds
Error: Could not send report: Permission denied @ dir_s_mkdir - /dev/null20200507-26509-53y7c8.lock

Puppet should not update its Puppet[:lastrunreport] or Puppet[:lastrunfile] when running in noop. I think this is a one line change:

diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb
index 6da432f15a..fe6fb79185 100644
--- a/lib/puppet/configurer.rb
+++ b/lib/puppet/configurer.rb
@@ -431,6 +431,7 @@ class Puppet::Configurer
   private :find_functional_server
 
   def send_report(report)
+    return if Puppet[:noop]
     puts report.summary if Puppet[:summarize]
     save_last_run_summary(report)
     Puppet::Transaction::Report.indirection.save(report, nil, :environment => Puppet::Node::Environment.remote(@environment)) if Puppet[:report]

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
May 7, 2020, 11:21:04 AM5/7/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Summary: Don't update lastrunreport and lastrunsummary in Incorrect return code for -- noop

Josh Cooper (Jira)

unread,
May 7, 2020, 11:24:02 AM5/7/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-2827
 
Re: Incorrect return code for --noop

Apparently people rely on noop submitting a last run report, so I put the old title back, and I'm going to close this as not a bug. To avoid the issue you can specify a location to save the lastrunreport (and optionally lastrunsummary if enabled) using:

 

$ puppet apply -e "" --noop --lastrunreport $(mktemp)

{nofomat}

 

Reply all
Reply to author
Forward
0 new messages