Issue #2421 has been reported by Nigel Kersten.
----------------------------------------
Bug #2421: puppet --detailed-exitcodes fails because
transaction.report.metrics["resources"][:failed] is incorrect.
http://projects.reductivelabs.com/issues/2421
Author: Nigel Kersten
Status: Unreviewed
Priority: Normal
Assigned to:
Category:
Target version:
Complexity: Unknown
Affected version: 0.25.0
Keywords:
>From checking the code in lib/puppet/application/puppet.rb, we see:
<pre>
status = 0
if not Puppet[:noop] and options[:detailed_exitcodes] then
transaction.generate_report
status |= 2 if transaction.report.metrics["changes"][:total] > 0
status |= 4 if transaction.report.metrics["resources"][:failed]
> 0
end
exit(status)
</pre>
so we should get a 6 exit status if we have changes to apply and any of them
failed right?
Applying this manifest:
<pre>
file {"/tmp/foo":
ensure => file,
content => "foo\n",
}
</pre>
then (on OSX, to replicate on Linux, use chattr rather than chflags):
<pre>
$ echo "not-foo" >> /tmp/foo
$ chflags uchg /tmp/foo
$ puppet -v --detailed-exitcodes /tmp/test.pp ; echo $?
notice: //File[/tmp/foo]: Filebucketed to puppet with sum
9152ab3f172b3e23fd6b1a3ab0e1d150
err: //File[/tmp/foo]: Could not rename tmp /tmp/foo for replacing: Operation
not permitted - /tmp/foo.puppettmp or /tmp/foo
notice: //File[/tmp/foo]/content: content changed
'{md5}9152ab3f172b3e23fd6b1a3ab0e1d150' to
'{md5}d3b07384d113edec49eaa6238ad5ff00'
2
</pre>
and inspecting <code>transaction.report.metrics["resources"][:failed]</code>
shows that it is indeed 0.
--
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://reductivelabs.com/redmine/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
-~----------~----~----~----~------~----~------~--~---