diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-06-08 16:30:29 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-06-08 16:30:29 -0700 |
commit | 329920ecbd9d310ef8e085e04b1976429139895e (patch) | |
tree | d59f4a5da6ed570ab33fe83d870898f1628b24d3 /chef/lib/chef/knife | |
parent | ff64e69e5b77478e3a9b452834f88d5790797369 (diff) | |
download | chef-329920ecbd9d310ef8e085e04b1976429139895e.tar.gz |
[CHEF-1279] fix regressions in cookbook upload from 1279
* don't exit 0 on failure, ever
* escape file separator b/c it's \ on win
Diffstat (limited to 'chef/lib/chef/knife')
-rw-r--r-- | chef/lib/chef/knife/cookbook_upload.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chef/lib/chef/knife/cookbook_upload.rb b/chef/lib/chef/knife/cookbook_upload.rb index 8e6ac2154e..9b72beaf04 100644 --- a/chef/lib/chef/knife/cookbook_upload.rb +++ b/chef/lib/chef/knife/cookbook_upload.rb @@ -208,10 +208,10 @@ class Chef result = shell_out("sh -c 'erubis -x #{erb_file} | ruby -c'") result.error! rescue Chef::Exceptions::ShellCommandFailed - file_relative_path = erb_file[/^#{Regexp.escape(cookbook_dir)}#{File::Separator}(.*)/, 1] + file_relative_path = erb_file[/^#{Regexp.escape(cookbook_dir+File::Separator)}(.*)/, 1] Chef::Log.fatal("Erb template #{file_relative_path} has a syntax error:") result.stderr.each_line { |l| Chef::Log.fatal(l.chomp) } - exit + exit(1) end def test_ruby_file(cookbook_dir, ruby_file) @@ -219,10 +219,10 @@ class Chef result = shell_out("ruby -c #{ruby_file}") result.error! rescue Chef::Exceptions::ShellCommandFailed - file_relative_path = ruby_file[/^#{Regexp.escape(cookbook_dir)}#{File::Separator}(.*)/, 1] + file_relative_path = ruby_file[/^#{Regexp.escape(cookbook_dir+File::Separator)}(.*)/, 1] Chef::Log.fatal("Cookbook file #{file_relative_path} has a syntax error:") result.stderr.each_line { |l| Chef::Log.fatal(l.chomp) } - exit + exit(1) end end |