diff options
-rw-r--r-- | .mailmap | 65 | ||||
-rw-r--r-- | DOC_CHANGES.md | 20 | ||||
-rw-r--r-- | Gemfile.lock | 26 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | acceptance/Gemfile.lock | 41 | ||||
-rw-r--r-- | chef-config/lib/chef-config/version.rb | 2 | ||||
-rw-r--r-- | kitchen-tests/Gemfile.lock | 28 | ||||
-rw-r--r-- | lib/chef/application/solo.rb | 10 | ||||
-rw-r--r-- | lib/chef/provider/package/chocolatey.rb | 18 | ||||
-rw-r--r-- | lib/chef/provider/package/portage.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/systemd_unit.rb | 18 | ||||
-rw-r--r-- | lib/chef/resource/systemd_unit.rb | 4 | ||||
-rw-r--r-- | lib/chef/version.rb | 2 | ||||
-rw-r--r-- | omnibus/Gemfile.lock | 30 | ||||
-rw-r--r-- | omnibus/config/software/chef-appbundle.rb | 3 | ||||
-rw-r--r-- | spec/functional/resource/chocolatey_package_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/application/solo_spec.rb | 25 | ||||
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 16 | ||||
-rw-r--r-- | spec/unit/provider/package/portage_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/systemd_unit_spec.rb | 63 |
20 files changed, 279 insertions, 107 deletions
@@ -1,5 +1,6 @@ # Daniel DeLeo Daniel DeLeo <dan@chef.io> Daniel DeLeo <dan@opscode.com> +Daniel DeLeo <dan@chef.io> danielsdeleo <dan@chef.io> Daniel DeLeo <dan@chef.io> Dan DeLeo <danielsdeleo@mac.com> Daniel DeLeo <dan@chef.io> Dan DeLeo <dan@kallistec.com> Daniel DeLeo <dan@chef.io> danielsdeleo <dan@getchef.com> @@ -62,11 +63,11 @@ Nuo Yan <nuo@opscode.com> Nuo Yan <nuoyan@nuo-yans-macbook-pro.(none)> Nuo Yan <nuo@opscode.com> Nuo Yan <nuoyan@nuo-yans-macbook-pro.local> # Thom May -Thom May <thom@clearairturbulence.org> -Thom May <thom@clearairturbulence.org> Thom May <thom.may@betfair.com> -Thom May <thom@clearairturbulence.org> Thom May <thom@digital-science.com> -Thom May <thom@clearairturbulence.org> Thom May <thom@virelais.nyc.joostas.com> -Thom May <thom@clearairturbulence.org> Thom May <tmay@expedia.com> +Thom May <thom@chef.io> Thom May <thom@clearairturbulence.org> +Thom May <thom@chef.io> Thom May <thom.may@betfair.com> +Thom May <thom@chef.io> Thom May <thom@digital-science.com> +Thom May <thom@chef.io> Thom May <thom@virelais.nyc.joostas.com> +Thom May <thom@chef.io> Thom May <tmay@expedia.com> # Stephen Delano Stephen Delano <stephen@chef.io> Stephen Delano <stephen@opscode.com> @@ -114,4 +115,56 @@ Marc Paradise <marc@chef.io> marc@opscode.com <marc@opscode.com> Tyler Ball <tyleraball@gmail.com> tyler-ball <tyleraball@gmail.com> # Steven Danna -Steven Danna <steve@chef.io> Steven Danna <steve@opscode.com>
\ No newline at end of file +Steven Danna <steve@chef.io> Steven Danna <steve@opscode.com> + +# Salim Alam +Salim Alam <salam@chef.io> chefsalim <salam@chef.io> + +# Isa Farnik +Isa Farnik <isa@chef.io> curiositycasualty <isa@getchef.com> +Isa Farnik <isa@chef.io> curiositycasualty <isa@opscode.com> + +# Paul Mooring +Paul Mooring <paul@chef.io> Paul Mooring <paul@opscode.com> + +# Jeremiah Snapp +Jeremiah Snapp <jeremiah@chef.io> Jeremiah Snapp <jeremiah@getchef.com> +Jeremiah Snapp <jeremiah@chef.io> Jeremiah Snapp <jeremiah.snapp@opscode.com> +Jeremiah Snapp <jeremiah@chef.io> Jeremiah Snapp <jeremiah@opscode.com> + +# Mark Myzk +Mark Mzyk <mmzyk@chef.io> Mark Mzyk <mmzyk@opscode.com> +Mark Mzyk <mmzyk@chef.io> mmzyk <mmzyk@opscode.com> +Mark Mzyk <mmzyk@chef.io> Mark Mzyk <markmzyk@Marks-MacBook-Pro.local> + +# Chris Doherty +Chris Doherty <cdoherty@chef.io> Chris Doherty <cdoherty@getchef.com> +Chris Doherty <cdoherty@chef.io> Chris Doherty <cdoherty@ooyala.com> +Chris Doherty <cdoherty@chef.io> Chris Doherty <randomcamel@users.noreply.github.com> +Chris Doherty <cdoherty@chef.io> unknown <cdoherty@chef.io> + +# Christopher Webber +Christopher Webber <cwebber@chef.io> Christopher Webber <cwebber@getchef.com> + +# Tyler Cloke +Tyler Cloke <tyler@chef.io> tylercloke <tyler@opscode.com> +Tyler Cloke <tyler@chef.io> tylercloke <tylercloke@gmail.com> +Tyler Cloke <tyler@chef.io> Tyler Cloke <tylercloke@gmail.com> + +# Julian Dunn +Julian C. Dunn <jdunn@chef.io> Julian C. Dunn <jdunn@getchef.com> +Julian C. Dunn <jdunn@chef.io> Julian C. Dunn <jdunn@opscode.com> +Julian C. Dunn <jdunn@chef.io> Julian C. Dunn <jdunn@aquezada.com> + +# Tom Duffield +Tom Duffield <tom@chef.io> Tom Duffield <tom@getchef.com> +Tom Duffield <tom@chef.io> Tom Duffield <tom@opscode.com> + +# Scott Hain +Scott Hain <shain@chef.io> Scott Hain <shain@getchef.com> + +# Peter Burkholder +Peter Burkholder <pburkholder@chef.io> Peter Burkholder <peterb@getchef.com> + +# JJ Ashgar +JJ Asghar <jj@chef.io> JJ Asghar <jj@getchef.com> diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md index 90b57c7e34..069cdc62b4 100644 --- a/DOC_CHANGES.md +++ b/DOC_CHANGES.md @@ -6,17 +6,15 @@ Example Doc Change: Description of the required change. --> -## Doc changes for Chef 12.9 +## Doc changes for Chef 12.11 -### New timeout option added to `knife ssh` +### RFC 062 Exit Status Support -When doing a `knife ssh` call, if a connection to a host is not able -to succeed due to host unreachable or down, the entire call can hang. In -order to prevent this from happening, a new timeout option has been added -to allow a connection timeout to be passed to the underlying SSH call -(see ConnectTimeout setting in http://linux.die.net/man/5/ssh_config) +Starting with Chef Client 12.11, there is support for the consistent, standard exit codes as defined in [Chef RFC 062](https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md). + +With no additional configuration when Chef Client exits with a non-standard exit code a deprecation warning will be issued advising users of the upcoming change in behavior. + +To enable the standardized exit code behavior, there is a new setting in client.rb. The `exit_status` setting, when set to `:enabled` will enforce standarized exit codes. In a future release, this will become the default behavior. + +If you need to maintain the previous exit code behavior to support your current workflow, you can disable this (and the deprecation warnings) by setting `exit_status` to `:disabled`. -The timeout setting can be passed in via a command line parameter -(`-t` or `--ssh-timeout`) or via a knife config -(`Chef::Config[:knife][:ssh_timeout]`). The value of the timeout is set -in seconds. diff --git a/Gemfile.lock b/Gemfile.lock index 7e981fd553..6519e24db1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,9 +18,9 @@ GIT PATH remote: . specs: - chef (12.11.7) + chef (12.11.14) bundler (>= 1.10) - chef-config (= 12.11.7) + chef-config (= 12.11.14) chef-zero (~> 4.5) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) @@ -45,9 +45,9 @@ PATH specinfra (~> 2.10) syslog-logger (~> 1.6) uuidtools (~> 2.1.5) - chef (12.11.7-universal-mingw32) + chef (12.11.14-universal-mingw32) bundler (>= 1.10) - chef-config (= 12.11.7) + chef-config (= 12.11.14) chef-zero (~> 4.5) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) @@ -87,7 +87,7 @@ PATH PATH remote: chef-config specs: - chef-config (12.11.7) + chef-config (12.11.14) fuzzyurl (~> 0.8.0) mixlib-config (~> 2.0) mixlib-shellout (~> 2.0) @@ -100,19 +100,19 @@ GEM mixlib-cli (~> 1.4) artifactory (2.3.2) ast (2.2.0) - aws-sdk (2.3.8) - aws-sdk-resources (= 2.3.8) - aws-sdk-core (2.3.8) + aws-sdk (2.3.9) + aws-sdk-resources (= 2.3.9) + aws-sdk-core (2.3.9) jmespath (~> 1.0) - aws-sdk-resources (2.3.8) - aws-sdk-core (= 2.3.8) + aws-sdk-resources (2.3.9) + aws-sdk-core (= 2.3.9) aws-sdk-v1 (1.66.0) json (~> 1.4) nokogiri (>= 1.4.4) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) - byebug (9.0.4) + byebug (9.0.5) chef-api (0.6.0) logify (~> 0.1) mime-types @@ -158,7 +158,7 @@ GEM erubis (2.7.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) - fauxhai (3.4.0) + fauxhai (3.5.0) net-ssh ffi (1.9.10) ffi (1.9.10-x86-mingw32) @@ -433,4 +433,4 @@ DEPENDENCIES yard BUNDLED WITH - 1.11.2 + 1.12.5 @@ -1 +1 @@ -12.11.7
\ No newline at end of file +12.11.14
\ No newline at end of file diff --git a/acceptance/Gemfile.lock b/acceptance/Gemfile.lock index 774bd485d3..840e1a49c4 100644 --- a/acceptance/Gemfile.lock +++ b/acceptance/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/chef/chef-acceptance.git - revision: 47e931cec100dce8efae4369a5b03443eaf2b733 + revision: e92ddae46d2126864698b9c8e4fc4ec2dcc46c55 specs: chef-acceptance (0.2.0) mixlib-shellout (~> 2.0) @@ -11,13 +11,13 @@ GEM specs: addressable (2.4.0) artifactory (2.3.2) - aws-sdk (2.3.2) - aws-sdk-resources (= 2.3.2) - aws-sdk-core (2.3.2) + aws-sdk (2.3.9) + aws-sdk-resources (= 2.3.9) + aws-sdk-core (2.3.9) jmespath (~> 1.0) - aws-sdk-resources (2.3.2) - aws-sdk-core (= 2.3.2) - berkshelf (4.3.2) + aws-sdk-resources (2.3.9) + aws-sdk-core (= 2.3.9) + berkshelf (4.3.3) addressable (~> 2.3, >= 2.3.4) berkshelf-api-client (~> 2.0, >= 2.0.2) buff-config (~> 1.0) @@ -52,14 +52,14 @@ GEM celluloid-io (0.16.2) celluloid (>= 0.16.0) nio4r (>= 1.1.0) - chef-config (12.9.41) + chef-config (12.10.24) fuzzyurl (~> 0.8.0) mixlib-config (~> 2.0) mixlib-shellout (~> 2.0) cleanroom (1.0.0) coderay (1.1.1) diff-lcs (1.2.5) - docker-api (1.26.2) + docker-api (1.28.0) excon (>= 0.38.0) json erubis (2.7.0) @@ -75,11 +75,12 @@ GEM hashie (3.4.4) hitimes (1.2.4) httpclient (2.7.2) - inspec (0.20.1) + inspec (0.22.1) + hashie (~> 3.4) json (~> 1.8) method_source (~> 0.8) pry (~> 0) - r-train (~> 0.11) + r-train (~> 0.12) rainbow (~> 2) rspec (~> 3) rspec-its (~> 1.2) @@ -95,8 +96,8 @@ GEM multi_json retryable (~> 2.0) test-kitchen (~> 1.4, >= 1.4.1) - kitchen-inspec (0.12.5) - inspec (>= 0.14.1, < 1.0.0) + kitchen-inspec (0.14.0) + inspec (>= 0.22.0, < 1.0.0) test-kitchen (~> 1.6) kitchen-vagrant (0.20.0) test-kitchen (~> 1.4) @@ -112,7 +113,7 @@ GEM rspec-expectations (~> 3.2) rspec-mocks (~> 3.2) mixlib-config (2.2.1) - mixlib-install (1.0.11) + mixlib-install (1.0.12) artifactory mixlib-shellout mixlib-versioning @@ -120,7 +121,7 @@ GEM mixlib-shellout (2.2.6) mixlib-versioning (1.1.0) molinillo (0.4.5) - multi_json (1.12.0) + multi_json (1.12.1) multipart-post (2.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) @@ -133,8 +134,8 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - r-train (0.11.2) - docker-api (~> 1.26.2) + r-train (0.12.1) + docker-api (~> 1.26) json (~> 1.8) mixlib-shellout (~> 2.0) net-scp (~> 1.2) @@ -143,7 +144,7 @@ GEM winrm-fs (~> 0.3) rainbow (2.1.0) retryable (2.0.3) - ridley (4.5.0) + ridley (4.5.1) addressable buff-config (~> 1.0) buff-extensions (~> 1.0) @@ -188,7 +189,7 @@ GEM solve (2.0.3) molinillo (~> 0.4.2) semverse (~> 1.1) - test-kitchen (1.8.0) + test-kitchen (1.9.0) mixlib-install (~> 1.0, >= 1.0.4) mixlib-shellout (>= 1.2, < 3.0) net-scp (~> 1.1) @@ -232,4 +233,4 @@ DEPENDENCIES winrm-fs BUNDLED WITH - 1.11.2 + 1.12.5 diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index f48e5ceeec..c2f12c7c53 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -21,7 +21,7 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) - VERSION = "12.11.7" + VERSION = "12.11.14" end # diff --git a/kitchen-tests/Gemfile.lock b/kitchen-tests/Gemfile.lock index 3f59bf90fe..8ab7fbe707 100644 --- a/kitchen-tests/Gemfile.lock +++ b/kitchen-tests/Gemfile.lock @@ -3,12 +3,12 @@ GEM specs: addressable (2.4.0) artifactory (2.3.2) - aws-sdk (2.3.8) - aws-sdk-resources (= 2.3.8) - aws-sdk-core (2.3.8) + aws-sdk (2.3.9) + aws-sdk-resources (= 2.3.9) + aws-sdk-core (2.3.9) jmespath (~> 1.0) - aws-sdk-resources (2.3.8) - aws-sdk-core (= 2.3.8) + aws-sdk-resources (2.3.9) + aws-sdk-core (= 2.3.9) berkshelf (4.3.3) addressable (~> 2.3, >= 2.3.4) berkshelf-api-client (~> 2.0, >= 2.0.2) @@ -66,6 +66,7 @@ GEM builder (>= 2.1.2) hashie (3.4.4) hitimes (1.2.4) + hitimes (1.2.4-x86-mingw32) httpclient (2.7.2) inspec (0.22.1) hashie (~> 3.4) @@ -92,8 +93,8 @@ GEM multi_json retryable (~> 2.0) test-kitchen (~> 1.4, >= 1.4.1) - kitchen-inspec (0.13.0) - inspec (>= 0.20.0, < 1.0.0) + kitchen-inspec (0.14.0) + inspec (>= 0.22.0, < 1.0.0) test-kitchen (~> 1.6) kitchen-vagrant (0.20.0) test-kitchen (~> 1.4) @@ -109,12 +110,15 @@ GEM rspec-expectations (~> 3.2) rspec-mocks (~> 3.2) mixlib-config (2.2.1) - mixlib-install (1.0.11) + mixlib-install (1.0.12) artifactory mixlib-shellout mixlib-versioning mixlib-log (1.6.0) mixlib-shellout (2.2.6) + mixlib-shellout (2.2.6-universal-mingw32) + win32-process (~> 0.8.2) + wmi-lite (~> 1.0) mixlib-versioning (1.1.0) molinillo (0.4.5) multi_json (1.12.1) @@ -185,7 +189,7 @@ GEM solve (2.0.3) molinillo (~> 0.4.2) semverse (~> 1.1) - test-kitchen (1.8.0) + test-kitchen (1.9.0) mixlib-install (~> 1.0, >= 1.0.4) mixlib-shellout (>= 1.2, < 3.0) net-scp (~> 1.1) @@ -199,6 +203,8 @@ GEM varia_model (0.4.1) buff-extensions (~> 1.0) hashie (>= 2.0.2, < 4.0.0) + win32-process (0.8.3) + ffi (>= 1.0.0) winrm (1.8.1) builder (>= 2.1.2) gssapi (~> 1.2) @@ -212,9 +218,11 @@ GEM logging (>= 1.6.1, < 3.0) rubyzip (~> 1.1) winrm (~> 1.5) + wmi-lite (1.0.0) PLATFORMS ruby + x86-mingw32 DEPENDENCIES berkshelf @@ -228,4 +236,4 @@ DEPENDENCIES vagrant-wrapper BUNDLED WITH - 1.12.1 + 1.12.5 diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb index 0c66f6cf40..ecac3f4d4e 100644 --- a/lib/chef/application/solo.rb +++ b/lib/chef/application/solo.rb @@ -212,6 +212,7 @@ class Chef::Application::Solo < Chef::Application def run setup_signal_handlers reconfigure + for_ezra if Chef::Config[:ez] if !Chef::Config[:solo_legacy_mode] Chef::Application::Client.new.run else @@ -232,6 +233,14 @@ class Chef::Application::Solo < Chef::Application Chef::Log.deprecation("-r MUST be changed to --recipe-url, the -r option will be changed in Chef 13.0") if ARGV.include?("-r") if !Chef::Config[:solo_legacy_mode] + # Because we re-parse ARGV when we move to chef-client, we need to tidy up some options first. + ARGV.delete("--ez") + + # -r means something entirely different in chef-client land, so let's replace it with a "safe" value + if dash_r = ARGV.index("-r") + ARGV[dash_r] = "--recipe-url" + end + Chef::Config[:local_mode] = true else configure_legacy_mode! @@ -277,7 +286,6 @@ class Chef::Application::Solo < Chef::Application end def run_application - for_ezra if Chef::Config[:ez] if !Chef::Config[:client_fork] || Chef::Config[:once] # Run immediately without interval sleep or splay begin diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index ebd3f987cd..36bc170590 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -229,13 +229,11 @@ EOS def available_packages @available_packages ||= begin - cmd = [ "list -ar #{package_name_array.join ' '}" ] + cmd = [ "list -r #{package_name_array.join ' '}" ] cmd.push( "-source #{new_resource.source}" ) if new_resource.source - parse_list_output(*cmd).each_with_object({}) do |name_version, available| - name, version = name_version - if desired_name_versions[name].nil? || desired_name_versions[name] == version - available[name] = version - end + raw = parse_list_output(*cmd) + raw.keys.each_with_object({}) do |name, available| + available[name] = desired_name_versions[name] || raw[name] end end end @@ -252,15 +250,15 @@ EOS # (names are downcased for case-insenstive matching) # # @param cmd [String] command to run - # @return [Array] list output converted to ruby Hash + # @return [Hash] list output converted to ruby Hash def parse_list_output(*args) - list = [] + hash = {} choco_command(*args).stdout.each_line do |line| next if line.start_with?("Chocolatey v") name, version = line.split("|") - list << [ name.downcase, version.chomp ] + hash[name.downcase] = version.chomp end - list + hash end # Helper to downcase all names in an array diff --git a/lib/chef/provider/package/portage.rb b/lib/chef/provider/package/portage.rb index 7c52e43bff..52b46b04b4 100644 --- a/lib/chef/provider/package/portage.rb +++ b/lib/chef/provider/package/portage.rb @@ -41,7 +41,7 @@ class Chef globsafe_pkg = Chef::Util::PathHelper.escape_glob_dir(pkg) possibilities = Dir["/var/db/pkg/#{globsafe_category || "*"}/#{globsafe_pkg}-*"].map { |d| d.sub(%r{/var/db/pkg/}, "") } versions = possibilities.map do |entry| - if entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)} + if entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*[a-z]?((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)} [$&, $1] end end.compact diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb index a73d0bc0ad..b96a336765 100644 --- a/lib/chef/provider/systemd_unit.rb +++ b/lib/chef/provider/systemd_unit.rb @@ -143,6 +143,24 @@ class Chef end end + def action_try_restart + converge_by("try-restarting unit: #{new_resource.name}") do + systemctl_execute!("try-restart", new_resource.name) + end + end + + def action_reload_or_restart + converge_by("reload-or-restarting unit: #{new_resource.name}") do + systemctl_execute!("reload-or-restart", new_resource.name) + end + end + + def action_reload_or_try_restart + converge_by("reload-or-try-restarting unit: #{new_resource.name}") do + systemctl_execute!("reload-or-try-restart", new_resource.name) + end + end + def active? systemctl_execute("is-active", new_resource.name).exitstatus == 0 end diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb index 525e9ab35e..688f2e9dcd 100644 --- a/lib/chef/resource/systemd_unit.rb +++ b/lib/chef/resource/systemd_unit.rb @@ -29,7 +29,9 @@ class Chef :enable, :disable, :mask, :unmask, :start, :stop, - :restart, :reload + :restart, :reload, + :try_restart, :reload_or_restart, + :reload_or_try_restart property :enabled, [TrueClass, FalseClass] property :active, [TrueClass, FalseClass] diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 2d5b96e666..296c115ed2 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -21,7 +21,7 @@ class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = "12.11.7" + VERSION = "12.11.14" end # diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 0ee716cbb3..f165fa5d12 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -1,13 +1,13 @@ GIT remote: https://github.com/chef/omnibus-software.git - revision: 91797cdae99ca91cb87af877ceb4953610d45152 + revision: 2f04eff7dbec575cb2985d846dacd02a422cd36f specs: omnibus-software (4.0.0) omnibus (>= 5.2.0) GIT remote: https://github.com/chef/omnibus.git - revision: 7c98e2bbceb741711de408dceba7bd7c813713e4 + revision: a36e70caedceadfcf0d85e2adef44ba0218a60a6 specs: omnibus (5.4.0) aws-sdk (~> 2) @@ -38,12 +38,12 @@ GEM addressable (2.3.8) artifactory (2.3.2) awesome_print (1.6.1) - aws-sdk (2.3.4) - aws-sdk-resources (= 2.3.4) - aws-sdk-core (2.3.4) + aws-sdk (2.3.9) + aws-sdk-resources (= 2.3.9) + aws-sdk-core (2.3.9) jmespath (~> 1.0) - aws-sdk-resources (2.3.4) - aws-sdk-core (= 2.3.4) + aws-sdk-resources (2.3.9) + aws-sdk-core (= 2.3.9) berkshelf (3.3.0) addressable (~> 2.3.4) berkshelf-api-client (~> 1.2) @@ -75,7 +75,7 @@ GEM buff-shell_out (0.2.0) buff-ruby_engine (~> 0.1.0) builder (3.2.2) - byebug (9.0.3) + byebug (9.0.4) celluloid (0.16.0) timers (~> 4.0.0) celluloid-io (0.16.2) @@ -98,6 +98,7 @@ GEM faraday (0.9.2) multipart-post (>= 1.2, < 3) ffi (1.9.10) + ffi (1.9.10-x86-mingw32) ffi-yajl (2.2.3) libyajl2 (~> 1.2) fuzzyurl (0.8.0) @@ -107,6 +108,7 @@ GEM builder (>= 2.1.2) hashie (3.4.4) hitimes (1.2.4) + hitimes (1.2.4-x86-mingw32) httpclient (2.6.0.1) iostruct (0.0.4) ipaddress (0.8.3) @@ -130,14 +132,17 @@ GEM rspec-mocks (~> 3.2) mixlib-cli (1.6.0) mixlib-config (2.2.1) - mixlib-install (1.0.11) + mixlib-install (1.0.12) artifactory mixlib-shellout mixlib-versioning mixlib-log (1.6.0) mixlib-shellout (2.2.6) + mixlib-shellout (2.2.6-universal-mingw32) + win32-process (~> 0.8.2) + wmi-lite (~> 1.0) mixlib-versioning (1.1.0) - multi_json (1.12.0) + multi_json (1.12.1) multipart-post (1.2.0) net-scp (1.2.1) net-ssh (>= 2.6.5) @@ -224,6 +229,8 @@ GEM varia_model (0.4.1) buff-extensions (~> 1.0) hashie (>= 2.0.2, < 4.0.0) + win32-process (0.8.3) + ffi (>= 1.0.0) winrm (1.8.1) builder (>= 2.1.2) gssapi (~> 1.2) @@ -242,6 +249,7 @@ GEM PLATFORMS ruby + x86-mingw32 DEPENDENCIES berkshelf (~> 3.0) @@ -256,4 +264,4 @@ DEPENDENCIES winrm-fs (~> 0.4.0) BUNDLED WITH - 1.11.2 + 1.12.5 diff --git a/omnibus/config/software/chef-appbundle.rb b/omnibus/config/software/chef-appbundle.rb index 19228738c3..495f58bfb1 100644 --- a/omnibus/config/software/chef-appbundle.rb +++ b/omnibus/config/software/chef-appbundle.rb @@ -1,5 +1,8 @@ name "chef-appbundle" default_version "local_source" + +license :project_license + source path: project.files_path dependency "chef" diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb index fb51fd2d64..7bb6698daf 100644 --- a/spec/functional/resource/chocolatey_package_spec.rb +++ b/spec/functional/resource/chocolatey_package_spec.rb @@ -82,11 +82,6 @@ describe Chef::Resource::ChocolateyPackage, :windows_only do subject.package_name "blah" expect { subject.run_action(:install) }.to raise_error Chef::Exceptions::Package end - - it "raises if package version is not found" do - subject.version "3.0" - expect { subject.run_action(:install) }.to raise_error Chef::Exceptions::Package - end end context "upgrading a package" do diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 1c8ec2e11c..bb29261f5a 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -187,6 +187,31 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config expect(Chef::Config[:local_mode]).to be_truthy end + context "argv gets tidied up" do + before do + @original_argv = ARGV.dup + ARGV.clear + Chef::Config[:treat_deprecation_warnings_as_errors] = false + end + + after do + ARGV.replace(@original_argv) + end + + it "deletes --ez" do + ARGV << "--ez" + app.reconfigure + expect(ARGV.include?("--ez")).to be_falsey + end + + it "replaces -r with --recipe-url" do + ARGV.push("-r", "http://junglist.gen.nz/recipes.tgz") + app.reconfigure + expect(ARGV.include?("-r")).to be_falsey + expect(ARGV.include?("--recipe-url")).to be_truthy + end + end + it "runs chef-client in local mode" do allow(app).to receive(:setup_application).and_return(true) allow(app).to receive(:run_application).and_return(true) diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index 8eaa69b598..8344c3d0ec 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -59,7 +59,7 @@ Git|2.6.2 munin-node|1.6.1.20130823 EOF remote_list_obj = double(stdout: remote_list_stdout) - allow(provider).to receive(:shell_out!).with("#{choco_exe} list -ar #{package_names.join ' '}#{args}", { timeout: timeout }).and_return(remote_list_obj) + allow(provider).to receive(:shell_out!).with("#{choco_exe} list -r #{package_names.join ' '}#{args}", { timeout: timeout }).and_return(remote_list_obj) end describe "#initialize" do @@ -84,12 +84,6 @@ munin-node|1.6.1.20130823 expect(provider.candidate_version).to eql(["2.6.1"]) end - it "should set the candidate_version to nill if pinning to bogus version" do - allow_remote_list(["git"]) - new_resource.version("2.5.0") - expect(provider.candidate_version).to eql([nil]) - end - it "should set the candidate_version to nil if there is no candidate" do allow_remote_list(["vim"]) new_resource.package_name("vim") @@ -301,14 +295,6 @@ munin-node|1.6.1.20130823 expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package) end - it "installing a package version that does not exist throws an error" do - allow_remote_list(["git"]) - new_resource.package_name("git") - new_resource.version("2.7.0") - provider.load_current_resource - expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package) - end - it "installing multiple packages with a package that does not exist throws an error" do allow_remote_list(["git", "package-does-not-exist"]) new_resource.package_name(["git", "package-does-not-exist"]) diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb index c2ff1cc952..ebb5b3139f 100644 --- a/spec/unit/provider/package/portage_spec.rb +++ b/spec/unit/provider/package/portage_spec.rb @@ -56,6 +56,12 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do expect(@provider.current_resource.version).to eq("1.0.0-r1") end + it "should return a current resource with the correct version if the package is found with version with character" do + allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0d"]) + @provider.load_current_resource + expect(@provider.current_resource.version).to eq("1.0.0d") + end + it "should return a current resource with a nil version if the package is not found" do allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"]) @provider.load_current_resource diff --git a/spec/unit/provider/systemd_unit_spec.rb b/spec/unit/provider/systemd_unit_spec.rb index 0babc30808..42604c22eb 100644 --- a/spec/unit/provider/systemd_unit_spec.rb +++ b/spec/unit/provider/systemd_unit_spec.rb @@ -654,6 +654,69 @@ describe Chef::Provider::SystemdUnit do end end + describe "try-restarts the unit" do + context "when a user is specified" do + it "try-restarts the unit" do + current_resource.user(user_name) + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --user try-restart #{unit_name}", user_cmd_opts) + .and_return(shell_out_success) + provider.action_try_restart + end + end + + context "when no user is specified" do + it "try-restarts the unit" do + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --system try-restart #{unit_name}", {}) + .and_return(shell_out_success) + provider.action_try_restart + end + end + end + + describe "reload-or-restarts the unit" do + context "when a user is specified" do + it "reload-or-restarts the unit" do + current_resource.user(user_name) + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --user reload-or-restart #{unit_name}", user_cmd_opts) + .and_return(shell_out_success) + provider.action_reload_or_restart + end + end + + context "when no user is specified" do + it "reload-or-restarts the unit" do + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --system reload-or-restart #{unit_name}", {}) + .and_return(shell_out_success) + provider.action_reload_or_restart + end + end + end + + describe "reload-or-try-restarts the unit" do + context "when a user is specified" do + it "reload-or-try-restarts the unit" do + current_resource.user(user_name) + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --user reload-or-try-restart #{unit_name}", user_cmd_opts) + .and_return(shell_out_success) + provider.action_reload_or_try_restart + end + end + + context "when no user is specified" do + it "reload-or-try-restarts the unit" do + expect(provider).to receive(:shell_out_with_systems_locale!) + .with("#{systemctl_path} --system reload-or-try-restart #{unit_name}", {}) + .and_return(shell_out_success) + provider.action_reload_or_try_restart + end + end + end + describe "#active?" do before(:each) do provider.current_resource = current_resource |