- From: Cyril Scetbon <
>
- To:
- Subject: [chef] mixliv command run_command executed at compile time ?
- Date: Fri, 7 Feb 2014 19:07:35 +0100
Hi,
When the command used in the Mixlib::ShellOut.new does not exist, chef exits
with a compilation error
================================================================================
Recipe Compile Error in /tmp/cookbooks/hadoop/recipes/default.rb
================================================================================
Errno::ENOENT
-------------
No such file or directory - echo2 ok
In the following example it should start and exists as it should not find
package whois2
include_recipe "apt"
package "whois2" do
action :install
end
cmd = Mixlib::ShellOut.new("echo2 ok")
cmd.run_command
However, it exists with :
[2014-02-07T18:00:28+00:00] DEBUG: Re-raising exception: Errno::ENOENT - No
such file or directory - echo2 ok
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/unix.rb:268:in
`exec'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/unix.rb:268:in
`block in fork_subprocess'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/unix.rb:256:in
`fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/unix.rb:256:in
`fork_subprocess'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/unix.rb:40:in
`run_command'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:225:in
`run_command'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/hadoop/recipes/default.rb:19:in
`from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/mixin/from_file.rb:30:in
`instance_eval'
If I replace "echo2" by "echo" it exits with the expected error.
I suppose it's not an expected behaviour ? FYI, I used chef-solo 11.8.2
--
Cyril SCETBON
- [chef] mixliv command run_command executed at compile time ?, Cyril Scetbon, 02/07/2014
Archive powered by MHonArc 2.6.16.