Skip to content

Commit

Permalink
Work around relative solo.rb path bug
Browse files Browse the repository at this point in the history
NOTE: This is redundant after matschaffer#199 is merged

rel matschaffer#212. Ohai doesn't like relative reference to solo.rb
Currently this is unix only. Not sure if this issue is still valid on
windows. Need to adjust fix to return original path on windows boxes.
  • Loading branch information
jasherai committed Mar 19, 2013
1 parent 6cfd9e9 commit cf926a5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/chef/knife/solo_cook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,15 @@ def chef_version
v[0].strip == 'Chef' ? v[1].strip : ''
end

def node_chef_path
result ||= begin
run_command("readlink -f #{chef_path}").stdout.strip
end
end

def cook
ui.msg "Running Chef..."
cmd = "sudo chef-solo -c #{chef_path}/solo.rb -j #{chef_path}/#{node_config}"
cmd = "sudo chef-solo -c #{node_chef_path}/solo.rb -j #{node_chef_path}/#{node_config}"
cmd << " -l debug" if debug?
cmd << " -N #{config[:chef_node_name]}" if config[:chef_node_name]
cmd << " -W" if config[:why_run]
Expand Down

0 comments on commit cf926a5

Please sign in to comment.