Skip to content

Instantly share code, notes, and snippets.

@TheSultan
TheSultan / chef-client-output
Last active January 1, 2016 11:49
Chef File Resource Win32APIError
Recipe: <REDACTED>
* file[C:\Windows/system32/cmd.exe] action create[2013-12-26T18:38:07-05:00] INFO: Processing file[C:\Windows/system32/cmd.exe] action create (symp
================================================================================
Error executing action `create` on resource 'file[C:\Windows/system32/cmd.exe]'
================================================================================
Chef::Exceptions::Win32APIError
-------------------------------
The operation completed successfully.
@TheSultan
TheSultan / recipe.rb
Last active December 29, 2015 15:19
chef environment variable bug repro
ENV['DOESEXIST'] = "original value"
log "#{ENV['DOESNOTEXIST']}"
log "#{ENV['DOESEXIST']}"
execute "test script" do
command "echo %DOESEXIST% %DOESNOTEXIST% > out.txt"
environment ({ 'DOESEXIST' => "new value" , 'DOESNOTEXIST' => 'first value ever' })
end
# Inspect out.txt, it should say 'new value first value ever' but will say 'old value first value ever'