- From: Daniel Oliver <
>
- To: "
" <
>
- Subject: [chef] RE: Re: Windows execute resource, not_if and exit code 42
- Date: Wed, 9 Nov 2011 09:36:40 +0000
- Accept-language: en-US
- Acceptlanguage: en-US
I did at one point have a problem with the following returning code 42 at one
point, but I can't reproduce it after a night's sleep. It may have been
before I tried upgrading to Ruby 1.9.2 from 1.8.7, although rolling back
doesn’t cause it to occur either.
execute 'ipconfig /flushdns' do
only_if { resources('template[/etc/hosts]').updated? }
end
Dan.
-----Original Message-----
From: Daniel DeLeo
[mailto:
On Behalf Of Daniel DeLeo
Sent: 09 November 2011 08:02
To:
Subject: [chef] Re: Windows execute resource, not_if and exit code 42
On Tuesday, November 8, 2011 at 8:40 AM, Daniel Oliver wrote:
>
>
Hi chefs,
>
>
>
It appears that Windows commands executed with ShellOut are regularly
>
returning exit code 42 on success. I can work around this for the main
>
“execute” blocks by specifying the return code, but for those protected
>
with “not_if”, commands get run that shouldn’t be as the check performed is
>
exit_code!=0. For example, the following old block is near the top of my
>
run list (I realise that this could be replaced with a user block):
`not_if` and `only_if` actually use the older popen4 code (which we're slowly
phasing out) to run commands. I'm not aware of any windows-related changes to
this code since 0.9.x. Regardless, I'll look into fixing this for a new beta
release.
`execute` resources do, however, use ShellOut. Are you experiencing this
problem with execute resources in the 0.10.6 beta?
--
Dan DeLeo
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
Archive powered by MHonArc 2.6.16.