summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-11-25 14:45:10 -0800
committertyler-ball <tyleraball@gmail.com>2014-11-25 14:45:10 -0800
commit2e3ea9d76d4b8e912ff88b22b9cb29b9c8d9009c (patch)
tree70c0ccd28fab446b92a5db0ce6797fcfd49f7e2a
parent2cabf9c5ba969ff89128d5334e36a76c766fce93 (diff)
parent5bab29b02248a4468a7fbf7f6226c30255c3abe3 (diff)
downloadchef-2e3ea9d76d4b8e912ff88b22b9cb29b9c8d9009c.tar.gz
Merge branch 'master' into tball/contrib-pass
Conflicts: CHANGELOG.md
-rw-r--r--CHANGELOG.md4
-rw-r--r--MAINTAINERS.md88
-rw-r--r--lib/chef/config.rb2
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
-rw-r--r--lib/chef/provider/package/rubygems.rb2
-rw-r--r--spec/unit/config_spec.rb4
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb14
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb8
8 files changed, 119 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c1592d823..35ad446cb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@
removed securerandom patch
* [**Scott Bonds**](https://github.com/bonds)
add package support for OpenBSD
+* [**Lucy Wyman**](https://github.com/lucywyman)
+ Added support for handling empty version strings to rubygems provider.
+* [**Yulian Kuncheff**](https://github.com/Daegalus)
+ Correctly set the pre-release identifier during knife bootstrap.
* [**Anshul Sharma**](https://github.com/justanshulsharma)
`knife node run_list remove` now accepts run_list options in the same form as add
* [**Veres Lajos**](https://github.com/vlajos)
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
new file mode 100644
index 0000000000..0f6b25aee0
--- /dev/null
+++ b/MAINTAINERS.md
@@ -0,0 +1,88 @@
+# Maintainers
+
+This file lists how the Chef project is maintained. When making changes to the system, this
+file tells you who needs to review your patch - you need a simple majority of maintainers
+for the relevant subsystems to provide a :+1: on your pull request. Additionally, you need
+to not receive a veto from a Lieutenant or the Project Lead.
+
+Check out [How Chef is Maintained](https://github.com/opscode/chef-rfc/blob/master/rfc030-maintenance-policy.md#how-the-project-is-maintained) for details on the process, how to become
+a maintainer, lieutenant, or the project lead.
+
+# Project Lead
+
+[Adam Jacob](http://github.com/adamhjk)
+
+# Components
+
+## Chef Core
+
+Handles the core parts of the Chef DSL, base resource and provider
+infrastructure, and the Chef applications. Includes anything not covered by
+another component.
+
+### Lieutenant
+
+### Maintainers
+
+[Jon Cowie](http://github.com/jonlives)
+
+[Phil Dibowitz](https://github.com/jaymzh)
+
+## Dev Tools
+
+Chef Zero, Knife, Chef Apply and Chef Shell.
+
+### Lieutenant
+
+### Maintainers
+
+## Test Tools
+
+ChefSpec, Berkshelf (the chef bits), Test Kitchen (the Chef bits)
+
+### Lieutenant
+
+### Maintainers
+
+## Platform Specific Components
+
+The specific components of Chef related to a given platform - including (but not limited to) resources, providers, and the core DSL.
+
+## Enterprise Linux
+
+### Lieutenant
+
+### Maintainers
+
+[Jon Cowie](http://github.com/jonlives)
+
+## Ubuntu
+
+### Lieutenant
+
+### Maintainers
+
+## Windows
+
+### Lieutenant
+
+### Maintainers
+
+## Solaris
+
+### Lieutenant
+
+### Maintainers
+
+## AIX
+
+### Lieutenant
+
+### Maintainers
+
+## Mac OS X
+
+### Lieutenant
+
+### Maintainers
+
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 6c2cd00fd5..c3fd939628 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -632,7 +632,7 @@ class Chef
#
# For example, on CentOS 6 with ENV['LANG'] = "en_US.UTF-8",
# `locale -a`.split fails with ArgumentError invalid UTF-8 encoding.
- locales = shell_out_with_systems_locale("locale -a").stdout.split
+ locales = shell_out_with_systems_locale!("locale -a").stdout.split
case
when locales.include?('C.UTF-8')
'C.UTF-8'
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 81e9f0d933..ffc36436ec 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -135,7 +135,7 @@ CONFIG
def latest_current_chef_version_string
installer_version_string = nil
if @config[:prerelease]
- installer_version_string = "-p"
+ installer_version_string = ["-p"]
else
chef_version_string = if knife_config[:bootstrap_version]
knife_config[:bootstrap_version]
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index 05d5619f65..21689503f0 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -536,7 +536,7 @@ class Chef
else
src = @new_resource.source && " --source=#{@new_resource.source} --source=https://rubygems.org"
end
- if version
+ if !version.nil? && version.length > 0
shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src}#{opts}", :env=>nil)
else
shell_out!("#{gem_binary_path} install \"#{name}\" -q --no-rdoc --no-ri #{src}#{opts}", :env=>nil)
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 58fb229c96..ed2003e8bf 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -426,7 +426,7 @@ describe Chef::Config do
let(:locales) { locale_array.join("\n") }
before do
- allow(Chef::Config).to receive(:shell_out_with_systems_locale).with("locale -a").and_return(shell_out)
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale!).with("locale -a").and_return(shell_out)
end
shared_examples_for "a suitable locale" do
@@ -493,7 +493,7 @@ describe Chef::Config do
let(:locale_array) { [] }
before do
- allow(Chef::Config).to receive(:shell_out_with_systems_locale).and_raise("THIS IS AN ERROR")
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale!).and_raise("THIS IS AN ERROR")
end
it "should default to 'en_US.UTF-8'" do
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index 1291571358..af8fa3f698 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -205,4 +205,18 @@ EXPECTED
end
end
+ describe "prerelease" do
+ it "isn't set in the config_content by default" do
+ expect(bootstrap_context.config_content).not_to include("prerelease")
+ end
+
+ describe "when configured via cli" do
+ let(:config) {{:prerelease => true}}
+
+ it "uses CLI value" do
+ expect(bootstrap_context.latest_current_chef_version_string).to eq("-p")
+ end
+ end
+ end
+
end
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index a3a4772229..b4960b2af3 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -536,6 +536,14 @@ describe Chef::Provider::Package::Rubygems do
expect(@provider.action_install).to be_truthy
end
+ it "installs the gem by shelling out when options are provided but no version is given" do
+ @new_resource.options('-i /alt/install/location')
+ @new_resource.version('')
+ expected ="gem install \"rspec-core\" -q --no-rdoc --no-ri -i /alt/install/location"
+ expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider.action_install).to be_truthy
+ end
+
it "installs the gem via the gems api when options are given as a Hash" do
@new_resource.options(:install_dir => '/alt/install/location')
expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil, :install_dir => '/alt/install/location')