diff options
author | Seth Chisamore <schisamo@opscode.com> | 2011-04-22 17:36:19 -0400 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-04-22 16:56:49 -0700 |
commit | cc9a9650da966411219ff9216f40532f8577f8f4 (patch) | |
tree | 9825bc1089dd090f06d86543bb48938a28e482b4 | |
parent | caf215248885df3faa5131eb19cc70819671aa0b (diff) | |
download | chef-cc9a9650da966411219ff9216f40532f8577f8f4.tar.gz |
[CHEF-2259] knife bootstrap --bootstrap-version fixes
* knife bootstrap long option --bootstrap-version always parsed as boolean
* bootstrap_version should be nested within the knife namespace in Chef::Config
-rw-r--r-- | chef/lib/chef/knife/bootstrap.rb | 6 | ||||
-rw-r--r-- | chef/spec/unit/knife/bootstrap_spec.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/chef/lib/chef/knife/bootstrap.rb b/chef/lib/chef/knife/bootstrap.rb index 62d70b5392..7bb6082c28 100644 --- a/chef/lib/chef/knife/bootstrap.rb +++ b/chef/lib/chef/knife/bootstrap.rb @@ -66,9 +66,9 @@ class Chef :description => "Install the pre-release chef gems" option :bootstrap_version, - :long => "--bootstrap-version", + :long => "--bootstrap-version VERSION", :description => "The version of Chef to install", - :proc => lambda { |v| Chef::Config[:bootstrap_version] = v } + :proc => lambda { |v| Chef::Config[:knife][:bootstrap_version] = v } option :distro, :short => "-d DISTRO", @@ -210,7 +210,7 @@ class Chef ::Erubis::Context.send(:include, Chef::Knife::Bootstrap::TemplateHelper) def bootstrap_version_string(type=nil) - version = Chef::Config[:bootstrap_version] || Chef::VERSION + version = Chef::Config[:knife][:bootstrap_version] || Chef::VERSION case type when :gems if @config[:prerelease] diff --git a/chef/spec/unit/knife/bootstrap_spec.rb b/chef/spec/unit/knife/bootstrap_spec.rb index 678e40f47b..0a6fb46dbb 100644 --- a/chef/spec/unit/knife/bootstrap_spec.rb +++ b/chef/spec/unit/knife/bootstrap_spec.rb @@ -165,7 +165,7 @@ describe Chef::Knife::Bootstrap::TemplateHelper do describe "bootstrap_version_string" do after(:each) do - Chef::Config.delete :bootstrap_version + Chef::Config[:knife].delete(:bootstrap_version) end formats = { @@ -185,10 +185,10 @@ describe Chef::Knife::Bootstrap::TemplateHelper do end end - context "with Chef::Config[:bootstrap_version] set" do + context "with Chef::Config[:knife][:bootstrap_version] set" do before(:each) do @config_version = "0.9.12" - Chef::Config[:bootstrap_version] = @config_version + Chef::Config[:knife][:bootstrap_version] = @config_version end formats.each do |sym, format| |