From bf8204df931b066671bc527ffd02b940911a070b Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 12 Nov 2021 14:47:08 -0800 Subject: Fix DRR assertion parsing define_resource_requirements should not parse assertions for actions which are not being run. Signed-off-by: Lamont Granquist --- lib/chef/mixin/why_run.rb | 10 ++++++-- lib/chef/provider.rb | 2 +- spec/unit/mixin/why_run_spec.rb | 53 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 spec/unit/mixin/why_run_spec.rb diff --git a/lib/chef/mixin/why_run.rb b/lib/chef/mixin/why_run.rb index efe327168e..1954f574d3 100644 --- a/lib/chef/mixin/why_run.rb +++ b/lib/chef/mixin/why_run.rb @@ -242,8 +242,12 @@ class Chef end end - def initialize(resource, run_context) - @resource, @run_context = resource, run_context + attr_accessor :action + + def initialize(resource, run_context, action) + @resource = resource + @run_context = run_context + @action = action @assertions = Hash.new { |h, k| h[k] = [] } @blocked_actions = [] end @@ -305,6 +309,8 @@ class Chef # "You don't have sufficient privileges to delete #{@new_resource.path}") # end def assert(*actions) + return unless actions.include?(action.to_sym) + assertion = Assertion.new yield assertion actions.each { |action| @assertions[action] << assertion } diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb index e7d7ca84ff..296a22222c 100644 --- a/lib/chef/provider.rb +++ b/lib/chef/provider.rb @@ -269,7 +269,7 @@ class Chef end def requirements - @requirements ||= ResourceRequirements.new(@new_resource, run_context) + @requirements ||= ResourceRequirements.new(@new_resource, run_context, action) end def description(description = "NOT_PASSED") diff --git a/spec/unit/mixin/why_run_spec.rb b/spec/unit/mixin/why_run_spec.rb new file mode 100644 index 0000000000..16ee50fec4 --- /dev/null +++ b/spec/unit/mixin/why_run_spec.rb @@ -0,0 +1,53 @@ +# +# Copyright:: Copyright (c) Chef Software Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "spec_helper" + +describe Chef::Mixin::WhyRun::ResourceRequirements do + class TestResource < Chef::Resource + action_class do + def define_resource_requirements + requirements.assert(:boom) do |a| + a.assertion { raise "boom1" } + a.failure_message("#{raise "boom2"}") + a.whyrun("#{raise "boom3"}") + end + end + end + + action :boom do + # nothing + end + + action :noboom do + # nothing + end + end + + let(:node) { Chef::Node.new } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:run_context) { Chef::RunContext.new(node, {}, events) } + let(:resource) { TestResource.new("name", run_context) } + + it "raises an exception for an action where the assertions raise exceptions" do + expect { resource.run_action(:boom) }.to raise_error(StandardError) + end + + it "does not raise an exception for an action which has no assertions" do + resource.run_action(:noboom) + end +end -- cgit v1.2.1 From 20681f07c993db9add0939513dbc6598bb6c2efd Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 12 Nov 2021 15:01:16 -0800 Subject: be more explicit that boom2 should be in the error Signed-off-by: Lamont Granquist --- spec/unit/mixin/why_run_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/mixin/why_run_spec.rb b/spec/unit/mixin/why_run_spec.rb index 16ee50fec4..7e56433fea 100644 --- a/spec/unit/mixin/why_run_spec.rb +++ b/spec/unit/mixin/why_run_spec.rb @@ -44,7 +44,7 @@ describe Chef::Mixin::WhyRun::ResourceRequirements do let(:resource) { TestResource.new("name", run_context) } it "raises an exception for an action where the assertions raise exceptions" do - expect { resource.run_action(:boom) }.to raise_error(StandardError) + expect { resource.run_action(:boom) }.to raise_error(StandardError, /boom2/) end it "does not raise an exception for an action which has no assertions" do -- cgit v1.2.1 From 9924aedacbfb427fcb245c297c33ba51bdbceb8d Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 15 Nov 2021 22:42:04 -0800 Subject: Unit fixes and :all_actions support for DRR fixes Signed-off-by: Lamont Granquist --- lib/chef/mixin/why_run.rb | 2 +- lib/chef/provider.rb | 2 +- spec/unit/file_access_control_spec.rb | 2 +- spec/unit/provider/group/groupadd_spec.rb | 1 + spec/unit/provider/group/usermod_spec.rb | 4 ++-- spec/unit/provider/ifconfig_spec.rb | 2 ++ spec/unit/provider/package/bff_spec.rb | 1 + spec/unit/provider/package/solaris_spec.rb | 1 + spec/unit/provider/service/arch_service_spec.rb | 4 ++-- spec/unit/provider/service/debian_service_spec.rb | 1 + spec/unit/provider/service/gentoo_service_spec.rb | 1 + spec/unit/provider/service/macosx_spec.rb | 1 + spec/unit/provider/service/redhat_spec.rb | 5 ++++- spec/unit/provider/service/simple_service_spec.rb | 10 ++++++---- spec/unit/provider/user_spec.rb | 2 ++ 15 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/chef/mixin/why_run.rb b/lib/chef/mixin/why_run.rb index 1954f574d3..357c4a655d 100644 --- a/lib/chef/mixin/why_run.rb +++ b/lib/chef/mixin/why_run.rb @@ -309,7 +309,7 @@ class Chef # "You don't have sufficient privileges to delete #{@new_resource.path}") # end def assert(*actions) - return unless actions.include?(action.to_sym) + return unless actions.include?(action.to_sym) || actions.include?(:all_actions) assertion = Assertion.new yield assertion diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb index 296a22222c..80c58c09ee 100644 --- a/lib/chef/provider.rb +++ b/lib/chef/provider.rb @@ -269,7 +269,7 @@ class Chef end def requirements - @requirements ||= ResourceRequirements.new(@new_resource, run_context, action) + @requirements ||= ResourceRequirements.new(@new_resource, run_context, action || new_resource.action) end def description(description = "NOT_PASSED") diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb index dfa0bcf673..3b533ec014 100644 --- a/spec/unit/file_access_control_spec.rb +++ b/spec/unit/file_access_control_spec.rb @@ -35,7 +35,7 @@ describe Chef::FileAccessControl do @events = Chef::EventDispatch::Dispatcher.new @run_context = Chef::RunContext.new(@node, {}, @events) @current_resource = Chef::Resource::File.new("/tmp/different_file.txt") - @provider_requirements = Chef::Provider::ResourceRequirements.new(@resource, @run_context) + @provider_requirements = Chef::Provider::ResourceRequirements.new(@resource, @run_context, :create) @provider = double("File provider", requirements: @provider_requirements, manage_symlink_access?: false) @fac = Chef::FileAccessControl.new(@current_resource, @resource, @provider) diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb index 50ee766cdb..70e5b4a39e 100644 --- a/spec/unit/provider/group/groupadd_spec.rb +++ b/spec/unit/provider/group/groupadd_spec.rb @@ -169,6 +169,7 @@ describe Chef::Provider::Group::Groupadd do before do allow(File).to receive(:exist?).and_return(false) + provider.action = :modify provider.define_resource_requirements end diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb index e552516063..caac1857cf 100644 --- a/spec/unit/provider/group/usermod_spec.rb +++ b/spec/unit/provider/group/usermod_spec.rb @@ -58,18 +58,18 @@ describe Chef::Provider::Group::Usermod do end it "should raise an error when setting the entire group directly" do + @provider.action = :modify @provider.define_resource_requirements @provider.load_current_resource @provider.instance_variable_set("@group_exists", true) - @provider.action = :modify expect { @provider.run_action(@provider.process_resource_requirements) }.to raise_error(Chef::Exceptions::Group, "setting group members directly is not supported by #{@provider}, must set append true in group") end it "should raise an error when excluded_members are set" do + @provider.action = :modify @provider.define_resource_requirements @provider.load_current_resource @provider.instance_variable_set("@group_exists", true) - @provider.action = :modify @new_resource.append(true) @new_resource.excluded_members(["someone"]) expect { @provider.run_action(@provider.process_resource_requirements) }.to raise_error(Chef::Exceptions::Group, "excluded_members is not supported by #{@provider}") diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb index 668a3ca9d9..166fe24304 100644 --- a/spec/unit/provider/ifconfig_spec.rb +++ b/spec/unit/provider/ifconfig_spec.rb @@ -61,6 +61,7 @@ describe Chef::Provider::Ifconfig do expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0) end it "should thrown an exception when ifconfig fails" do + @provider.action = :add @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig end @@ -81,6 +82,7 @@ describe Chef::Provider::Ifconfig do expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0) end it "should thrown an exception when ifconfig fails" do + @provider.action = :add @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig end diff --git a/spec/unit/provider/package/bff_spec.rb b/spec/unit/provider/package/bff_spec.rb index 680e5cf22a..b32b7714e4 100644 --- a/spec/unit/provider/package/bff_spec.rb +++ b/spec/unit/provider/package/bff_spec.rb @@ -61,6 +61,7 @@ describe Chef::Provider::Package::Bff do allow(@provider).to receive(:shell_out_compacted).and_return(@empty_status) allow(::File).to receive(:exist?).with(@new_resource.source).and_return(false) @provider.load_current_resource + @provider.action = :install @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Package) end diff --git a/spec/unit/provider/package/solaris_spec.rb b/spec/unit/provider/package/solaris_spec.rb index c07367c221..874f030605 100644 --- a/spec/unit/provider/package/solaris_spec.rb +++ b/spec/unit/provider/package/solaris_spec.rb @@ -65,6 +65,7 @@ describe Chef::Provider::Package::Solaris do allow(@provider).to receive(:shell_out_compacted).and_return(@status) allow(::File).to receive(:exist?).and_return(false) @provider.load_current_resource + @provider.action = :install @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Package) end diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb index c92af83de5..496e876a49 100644 --- a/spec/unit/provider/service/arch_service_spec.rb +++ b/spec/unit/provider/service/arch_service_spec.rb @@ -95,15 +95,15 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do it "should raise error if the node has a nil ps property and no other means to get status" do @node.automatic_attrs[:command] = { ps: nil } - @provider.define_resource_requirements @provider.action = :start + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end it "should raise error if the node has an empty ps property and no other means to get status" do @node.automatic_attrs[:command] = { ps: "" } - @provider.define_resource_requirements @provider.action = :start + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb index 0ae1d28cd3..c3a478d249 100644 --- a/spec/unit/provider/service/debian_service_spec.rb +++ b/spec/unit/provider/service/debian_service_spec.rb @@ -50,6 +50,7 @@ describe Chef::Provider::Service::Debian do it "ensures /usr/sbin/update-rc.d is available" do expect(File).to receive(:exist?).with("/usr/sbin/update-rc.d").and_return(false) + @provider.action = :start @provider.define_resource_requirements expect do @provider.process_resource_requirements diff --git a/spec/unit/provider/service/gentoo_service_spec.rb b/spec/unit/provider/service/gentoo_service_spec.rb index f195fbe40b..efab722ac8 100644 --- a/spec/unit/provider/service/gentoo_service_spec.rb +++ b/spec/unit/provider/service/gentoo_service_spec.rb @@ -42,6 +42,7 @@ describe Chef::Provider::Service::Gentoo do describe "load_current_resource" do it "should raise Chef::Exceptions::Service if /sbin/rc-update does not exist" do expect(File).to receive(:exist?).with("/sbin/rc-update").and_return(false) + @provider.action = :start @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb index eafc857cf1..ebde71776a 100644 --- a/spec/unit/provider/service/macosx_spec.rb +++ b/spec/unit/provider/service/macosx_spec.rb @@ -237,6 +237,7 @@ describe Chef::Provider::Service::Macosx do allow(Dir).to receive(:glob).and_return([(plist).to_s, "/Users/wtf/something.plist"]) provider.load_current_resource + provider.action = :enable provider.define_resource_requirements expect { provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb index d5d2c7ddc0..1bf07b7f2c 100644 --- a/spec/unit/provider/service/redhat_spec.rb +++ b/spec/unit/provider/service/redhat_spec.rb @@ -34,6 +34,7 @@ shared_examples_for "define_resource_requirements_common" do expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status) chkconfig = double("Chkconfig", exitstatus: 0, stdout: "", stderr: "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')") expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", returns: [0, 1]).and_return(chkconfig) + @provider.action = :start @provider.load_current_resource @provider.define_resource_requirements expect { @provider.process_resource_requirements }.not_to raise_error @@ -147,12 +148,12 @@ describe "Chef::Provider::Service::Redhat" do chkconfig = double("Chkconfig", existatus: 1, stdout: "", stderr: "error reading information on service chef: No such file or directory") expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", returns: [0, 1]).and_return(chkconfig) @provider.load_current_resource - @provider.define_resource_requirements end %w{start reload restart enable}.each do |action| it "should raise an error when the action is #{action}" do @provider.action = action + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end end @@ -161,12 +162,14 @@ describe "Chef::Provider::Service::Redhat" do it "should not raise an error when the action is #{action} and init_command is set" do @new_resource.init_command("/etc/init.d/chef") @provider.action = action + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.not_to raise_error end it "should not raise an error when the action is #{action} and #{action}_command is set" do @new_resource.send("#{action}_command", "/etc/init.d/chef #{action}") @provider.action = action + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.not_to raise_error end end diff --git a/spec/unit/provider/service/simple_service_spec.rb b/spec/unit/provider/service/simple_service_spec.rb index 2546f9cef7..e114d3e314 100644 --- a/spec/unit/provider/service/simple_service_spec.rb +++ b/spec/unit/provider/service/simple_service_spec.rb @@ -52,12 +52,14 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do it "should raise error if the node has a nil ps property and no other means to get status" do @node.automatic_attrs[:command] = { ps: nil } + @provider.action = :start @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end it "should raise error if the node has an empty ps property and no other means to get status" do @node.automatic_attrs[:command] = { ps: "" } + @provider.action = :start @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end @@ -112,8 +114,8 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do end it "should raise an exception if no start command is specified" do - @provider.define_resource_requirements @provider.action = :start + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end end @@ -126,8 +128,8 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do end it "should raise an exception if no stop command is specified" do - @provider.define_resource_requirements @provider.action = :stop + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end end @@ -140,8 +142,8 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do end it "should raise an exception if the resource doesn't support restart, no restart command is provided, and no stop command is provided" do - @provider.define_resource_requirements @provider.action = :restart + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service) end @@ -155,8 +157,8 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do describe Chef::Provider::Service::Simple, "reload_service" do it "should raise an exception if reload is requested but no command is specified" do - @provider.define_resource_requirements @provider.action = :reload + @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::UnsupportedAction) end diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb index 16428de1a9..c8ad656f06 100644 --- a/spec/unit/provider/user_spec.rb +++ b/spec/unit/provider/user_spec.rb @@ -170,6 +170,7 @@ describe Chef::Provider::User do sp_warn: 7, sp_inact: -1, sp_expire: -1, sp_flag: -1) expect(Shadow::Passwd).to receive(:getspnam).with("notarealuser").and_return(passwd_info) @provider.load_current_resource + @provider.action = :create @provider.define_resource_requirements @provider.process_resource_requirements end @@ -180,6 +181,7 @@ describe Chef::Provider::User do it "should fail assertions when ruby-shadow cannot be loaded" do expect(@provider).to receive(:require).with("shadow") { raise LoadError } @provider.load_current_resource + @provider.action = :create @provider.define_resource_requirements expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::MissingLibrary end -- cgit v1.2.1 From 20437aedf7bfd3dbb3b7c877ad7618aa103599a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 14:35:11 +0000 Subject: Bump omnibus-software from `32876cd` to `7501e20` in /omnibus Bumps [omnibus-software](https://github.com/chef/omnibus-software) from `32876cd` to `7501e20`. - [Release notes](https://github.com/chef/omnibus-software/releases) - [Commits](https://github.com/chef/omnibus-software/compare/32876cd385807cd29b7b33cee219ad028dcc6f5f...7501e2036a654e4918e9fffd8ee6ef69f3b7f633) --- updated-dependencies: - dependency-name: omnibus-software dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- omnibus/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index aaf22c7c2a..a749d9b83e 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/chef/omnibus-software.git - revision: 32876cd385807cd29b7b33cee219ad028dcc6f5f + revision: 7501e2036a654e4918e9fffd8ee6ef69f3b7f633 branch: main specs: omnibus-software (4.0.0) @@ -33,7 +33,7 @@ GEM artifactory (3.0.15) awesome_print (1.9.2) aws-eventstream (1.2.0) - aws-partitions (1.530.0) + aws-partitions (1.531.0) aws-sdk-core (3.122.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) -- cgit v1.2.1 From 9a4358e5bd3087ab94234bdef4da1276009707ad Mon Sep 17 00:00:00 2001 From: rishichawda Date: Tue, 31 Aug 2021 16:04:34 +0530 Subject: use powershell_exec helper in powershell_package resource Signed-off-by: rishichawda --- .rubocop.yml | 1 - lib/chef/provider/package/powershell.rb | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b6e3e47b30..5779258102 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -41,7 +41,6 @@ Chef/Ruby/LegacyPowershellOutMethods: - 'spec/functional/mixin/powershell_out_spec.rb' - 'spec/unit/mixin/powershell_out_spec.rb' - 'lib/chef/resource/windows_feature_powershell.rb' # https://github.com/chef/chef/issues/10927 - - 'lib/chef/provider/package/powershell.rb' # https://github.com/chef/chef/issues/10926 # set additional paths Chef/Ruby/UnlessDefinedRequire: diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb index 1c123d7952..90543c29f0 100644 --- a/lib/chef/provider/package/powershell.rb +++ b/lib/chef/provider/package/powershell.rb @@ -17,13 +17,13 @@ require_relative "../package" require_relative "../../resource/powershell_package" -require_relative "../../mixin/powershell_out" +require_relative "../../mixin/powershell_exec" class Chef class Provider class Package class Powershell < Chef::Provider::Package - include Chef::Mixin::PowershellOut + include Chef::Mixin::PowershellExec provides :powershell_package @@ -54,9 +54,9 @@ class Chef # Installs the package specified with the version passed else latest version will be installed def install_package(names, versions) names.each_with_index do |name, index| - cmd = powershell_out(build_powershell_package_command("Install-Package '#{name}'", versions[index]), timeout: new_resource.timeout) + cmd = powershell_exec(build_powershell_package_command("Install-Package '#{name}'", versions[index]), timeout: new_resource.timeout) next if cmd.nil? - raise Chef::Exceptions::PowershellCmdletException, "Failed to install package due to catalog signing error, use skip_publisher_check to force install" if /SkipPublisherCheck/.match?(cmd.stderr) + raise Chef::Exceptions::PowershellCmdletException, "Failed to install package due to catalog signing error, use skip_publisher_check to force install" if /SkipPublisherCheck/.match?(cmd.error) end end @@ -64,11 +64,11 @@ class Chef def remove_package(names, versions) names.each_with_index do |name, index| if versions && !versions[index].nil? - powershell_out(build_powershell_package_command("Uninstall-Package '#{name}'", versions[index]), timeout: new_resource.timeout) + powershell_exec(build_powershell_package_command("Uninstall-Package '#{name}'", versions[index]), timeout: new_resource.timeout) else version = "0" until version.empty? - version = powershell_out(build_powershell_package_command("Uninstall-Package '#{name}'"), timeout: new_resource.timeout).stdout.strip + version = powershell_exec(build_powershell_package_command("Uninstall-Package '#{name}'"), timeout: new_resource.timeout).result.strip unless version.empty? logger.info("Removed package '#{name}' with version #{version}") end @@ -82,9 +82,9 @@ class Chef versions = [] new_resource.package_name.each_with_index do |name, index| version = if new_resource.version && !new_resource.version[index].nil? - powershell_out(build_powershell_package_command("Find-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).stdout.strip + powershell_exec(build_powershell_package_command("Find-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result.strip else - powershell_out(build_powershell_package_command("Find-Package '#{name}'"), timeout: new_resource.timeout).stdout.strip + powershell_exec(build_powershell_package_command("Find-Package '#{name}'"), timeout: new_resource.timeout).result.strip end if version.empty? version = nil @@ -99,9 +99,9 @@ class Chef version_list = [] new_resource.package_name.each_with_index do |name, index| version = if new_resource.version && !new_resource.version[index].nil? - powershell_out(build_powershell_package_command("Get-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).stdout.strip + powershell_exec(build_powershell_package_command("Get-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result.strip else - powershell_out(build_powershell_package_command("Get-Package '#{name}'"), timeout: new_resource.timeout).stdout.strip + powershell_exec(build_powershell_package_command("Get-Package '#{name}'"), timeout: new_resource.timeout).result.strip end if version.empty? version = nil -- cgit v1.2.1 From f9656086403bdf559dd72197c9ef02b0cb0f8f88 Mon Sep 17 00:00:00 2001 From: rishichawda Date: Wed, 1 Sep 2021 22:39:34 +0530 Subject: update tests for powershell package Signed-off-by: rishichawda --- spec/unit/provider/package/powershell_spec.rb | 228 +++++++++++++------------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/spec/unit/provider/package/powershell_spec.rb b/spec/unit/provider/package/powershell_spec.rb index 8bf95b9b14..501ad46c7b 100644 --- a/spec/unit/provider/package/powershell_spec.rb +++ b/spec/unit/provider/package/powershell_spec.rb @@ -17,10 +17,10 @@ # require "spec_helper" -require "chef/mixin/powershell_out" +require "chef/mixin/powershell_exec" describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do - include Chef::Mixin::PowershellOut + include Chef::Mixin::PowershellExec let(:timeout) { 900 } let(:source) { nil } @@ -35,63 +35,63 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do end let(:package_xcertificate_installed) do - double("powershell_out", stdout: "2.1.0.0\r\n") + double("powershell_exec", result: "2.1.0.0\r\n") end let(:package_xcertificate_installed_2_0_0_0) do - double("powershell_out", stdout: "2.0.0.0\r\n") + double("powershell_exec", result: "2.0.0.0\r\n") end let(:package_xcertificate_available) do - double("powershell_out", stdout: "2.1.0.0\r\n") + double("powershell_exec", result: "2.1.0.0\r\n") end let(:package_xcertificate_available_2_0_0_0) do - double("powershell_out", stdout: "2.0.0.0\r\n") + double("powershell_exec", result: "2.0.0.0\r\n") end let(:package_xcertificate_not_installed) do - double("powershell_out", stdout: "") + double("powershell_exec", result: "") end let(:package_xcertificate_not_available) do - double("powershell_out", stdout: "") + double("powershell_exec", result: "") end let(:package_xnetworking_installed) do - double("powershell_out", stdout: "2.12.0.0\r\n") + double("powershell_exec", result: "2.12.0.0\r\n") end let(:package_xnetworking_installed_2_11_0_0) do - double("powershell_out", stdout: "2.11.0.0\r\n") + double("powershell_exec", result: "2.11.0.0\r\n") end let(:package_xnetworking_available) do - double("powershell_out", stdout: "2.12.0.0\r\n") + double("powershell_exec", result: "2.12.0.0\r\n") end let(:package_xnetworking_available_2_11_0_0) do - double("powershell_out", stdout: "2.11.0.0\r\n") + double("powershell_exec", result: "2.11.0.0\r\n") end let(:package_xnetworking_not_installed) do - double("powershell_out", stdout: "") + double("powershell_exec", result: "") end let(:package_xnetworking_not_available) do - double("powershell_out", stdout: "") + double("powershell_exec", result: "") end let(:package_7zip_available) do - double("powershell_out", stdout: "16.02\r\n") + double("powershell_exec", result: "16.02\r\n") end let(:package_7zip_not_installed) do - double("powershell_out", stdout: "") + double("powershell_exec", result: "") end let(:powershell_installed_version) do - double("powershell_out", stdout: "5") + double("powershell_exec", result: "5") end let(:tls_set_command) { "if ([Net.ServicePointManager]::SecurityProtocol -lt [Net.SecurityProtocolType]::Tls12) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 };" } @@ -122,14 +122,14 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do describe "#candidate_version" do it "should set the candidate_version to the latest version when not pinning" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) new_resource.package_name(["xNetworking"]) new_resource.version(nil) expect(provider.candidate_version).to eql(["2.12.0.0"]) end it "should use the candidate_version from the correct source" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) new_resource.package_name(["xNetworking"]) new_resource.version(nil) new_resource.source("MyGallery") @@ -137,60 +137,60 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do end it "should set the candidate_version to the latest version when not pinning and package name is space separated" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available) new_resource.package_name(["7-Zip 16.02 (x64)"]) new_resource.version(nil) expect(provider.candidate_version).to eql(["16.02"]) end it "should set the candidate_version to pinned version if available" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.0.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available_2_0_0_0) new_resource.package_name(["xCertificate"]) new_resource.version(["2.0.0.0"]) expect(provider.candidate_version).to eql(["2.0.0.0"]) end it "should set the candidate_version to nil if there is no candidate" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) new_resource.package_name(["xCertificate"]) expect(provider.candidate_version).to eql([nil]) end it "should set the candidate_version correctly when there are two packages to install" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) expect(provider.candidate_version).to eql(["2.1.0.0", "2.12.0.0"]) end it "should set the candidate_version correctly when only the first is installable" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) expect(provider.candidate_version).to eql(["2.1.0.0", nil]) end it "should set the candidate_version correctly when only the last is installable" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) expect(provider.candidate_version).to eql([nil, "2.12.0.0"]) end it "should set the candidate_version correctly when neither are is installable and version is passed as nil array" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) new_resource.package_name(%w{xNetworking xCertificate}) new_resource.version([nil, nil]) expect(provider.candidate_version).to eql([nil, nil]) end it "should set the candidate_version correctly when neither are is installable and version is not passed" do - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) new_resource.package_name(%w{xNetworking xCertificate}) new_resource.version(nil) expect(provider.candidate_version).to eql([nil, nil]) @@ -322,10 +322,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do provider.load_current_resource new_resource.package_name(["xCertificate"]) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -335,10 +335,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do new_resource.package_name(["xCertificate"]) new_resource.version(nil) new_resource.source("MyGallery") - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -348,10 +348,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do new_resource.package_name(["xCertificate"]) new_resource.version(nil) new_resource.skip_publisher_check(true) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -SkipPublisherCheck ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -360,10 +360,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do provider.load_current_resource new_resource.package_name(["7-Zip 16.02 (x64)"]) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_7zip_not_installed) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package '7-Zip 16.02 (x64)' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 16.02 ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -375,10 +375,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do provider.load_current_resource new_resource.package_name(["xCertificate"]) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -387,9 +387,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "should not install packages that are up-to-date" do new_resource.package_name(["xCertificate"]) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource expect(provider).not_to receive(:install_package) provider.run_action(:install) @@ -399,9 +399,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "should not install packages that are up-to-date" do new_resource.package_name(["xNetworking"]) new_resource.version(["2.11.0.0"]) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource expect(provider).not_to receive(:install_package) provider.run_action(:install) @@ -413,13 +413,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do # new_version.resource[0] new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version([nil, "2.11.0.0"]) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available_2_11_0_0) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.11.0.0 ).Version", { timeout: new_resource.timeout }) provider.load_current_resource provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -428,13 +428,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "should split up commands when given two packages, one with a version pin" do new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(["2.1.0.0", nil]) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout }) provider.load_current_resource provider.run_action(:install) @@ -444,13 +444,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "should do multipackage installs when given two packages without constraints" do new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 ).Version", { timeout: new_resource.timeout }) provider.load_current_resource provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -460,13 +460,13 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) new_resource.source("MyGallery") - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -Source MyGallery ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.12.0.0 -Source MyGallery ).Version", { timeout: new_resource.timeout }) provider.load_current_resource provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -477,10 +477,10 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do new_resource.package_name(["xCertificate"]) new_resource.version(nil) new_resource.options(%w{-AcceptLicense -Verbose}) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -AcceptLicense -Verbose ).Version", { timeout: new_resource.timeout }) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Install-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -AcceptLicense -Verbose ).Version", { timeout: new_resource.timeout }) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action end @@ -491,9 +491,9 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do provider.load_current_resource new_resource.package_name(["xCertificate"]) new_resource.version(["2.1.0.0"]) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) expect(provider).not_to receive(:remove_package) provider.run_action(:remove) expect(new_resource).not_to be_updated_by_last_action @@ -503,11 +503,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do new_resource.package_name(["xCertificate"]) new_resource.version(["2.1.0.0"]) new_resource.source("MyGallery") - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 -Source MyGallery).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action end @@ -515,11 +515,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "does nothing when all the packages are already removed" do new_resource.package_name(%w{xCertificate xNetworking}) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xNetworking' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xnetworking_not_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource expect(provider).not_to receive(:remove_package) provider.run_action(:remove) @@ -529,11 +529,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "removes a package when version is specified" do new_resource.package_name(["xCertificate"]) new_resource.version(["2.1.0.0"]) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -RequiredVersion 2.1.0.0 ).Version", { timeout: new_resource.timeout }) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action end @@ -541,11 +541,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "removes a package when version is not specified" do new_resource.package_name(["xCertificate"]) new_resource.version(nil) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action end @@ -553,11 +553,11 @@ describe Chef::Provider::Package::Powershell, :windows_only, :windows_gte_10 do it "should remove a package using provided options" do new_resource.package_name(["xCertificate"]) new_resource.options(%w{-AllVersions}) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) - allow(provider).to receive(:powershell_out).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Find-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Get-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_available) + allow(provider).to receive(:powershell_exec).with("$PSVersionTable.PSVersion.Major").and_return(powershell_installed_version) provider.load_current_resource - expect(provider).to receive(:powershell_out).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -AllVersions ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) + expect(provider).to receive(:powershell_exec).with("#{tls_set_command} ( Uninstall-Package 'xCertificate' -Force -ForceBootstrap -WarningAction SilentlyContinue -AllVersions ).Version", { timeout: new_resource.timeout }).and_return(package_xcertificate_not_available) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action end -- cgit v1.2.1 From 1d1c8e39f38322e8b90827252e8102877fbc9e28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:19:57 +0000 Subject: Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus Bumps [test-kitchen](https://github.com/test-kitchen/test-kitchen) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/test-kitchen/test-kitchen/releases) - [Changelog](https://github.com/test-kitchen/test-kitchen/blob/master/CHANGELOG.md) - [Commits](https://github.com/test-kitchen/test-kitchen/compare/v3.1.1...v3.2.0) --- updated-dependencies: - dependency-name: test-kitchen dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- omnibus/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index aaf22c7c2a..f19c673140 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -363,7 +363,7 @@ GEM strings-ansi (0.2.0) structured_warnings (0.4.0) syslog-logger (1.6.8) - test-kitchen (3.1.1) + test-kitchen (3.2.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) -- cgit v1.2.1 From 366c6bcf4895c1610f350df6c8890f302fa9dcc5 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Fri, 19 Nov 2021 06:25:24 +0000 Subject: Bump inspec-core-bin to 4.50.3 This pull request was triggered automatically via Expeditor when inspec-core-bin 4.50.3 was promoted to Rubygems. This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required. --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a473ab6580..f1343ebff9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,7 +142,7 @@ GEM mixlib-shellout (>= 2.0, < 4.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.532.0) + aws-partitions (1.533.0) aws-sdk-core (3.122.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -225,7 +225,7 @@ GEM hashie (4.1.0) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.49.0) + inspec-core (4.50.3) addressable (~> 2.4) chef-telemetry (~> 1.0, >= 1.0.8) faraday (>= 0.9.0, < 1.5) @@ -248,8 +248,8 @@ GEM train-core (~> 3.0) tty-prompt (~> 0.17) tty-table (~> 0.10) - inspec-core-bin (4.49.0) - inspec-core (= 4.49.0) + inspec-core-bin (4.50.3) + inspec-core (= 4.50.3) ipaddress (0.8.3) iso8601 (0.13.0) jmespath (1.4.0) -- cgit v1.2.1 From 68da6f8f406f392edda66b00e726728f93a34c6f Mon Sep 17 00:00:00 2001 From: rishichawda Date: Fri, 19 Nov 2021 18:45:28 +0530 Subject: call strip only when string is returned Signed-off-by: rishichawda --- lib/chef/provider/package/powershell.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb index 90543c29f0..2fe6cc2abc 100644 --- a/lib/chef/provider/package/powershell.rb +++ b/lib/chef/provider/package/powershell.rb @@ -68,7 +68,8 @@ class Chef else version = "0" until version.empty? - version = powershell_exec(build_powershell_package_command("Uninstall-Package '#{name}'"), timeout: new_resource.timeout).result.strip + version = powershell_exec(build_powershell_package_command("Uninstall-Package '#{name}'"), timeout: new_resource.timeout).result + version = version.strip if version.respond_to?(:strip) unless version.empty? logger.info("Removed package '#{name}' with version #{version}") end @@ -82,13 +83,14 @@ class Chef versions = [] new_resource.package_name.each_with_index do |name, index| version = if new_resource.version && !new_resource.version[index].nil? - powershell_exec(build_powershell_package_command("Find-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result.strip + powershell_exec(build_powershell_package_command("Find-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result else - powershell_exec(build_powershell_package_command("Find-Package '#{name}'"), timeout: new_resource.timeout).result.strip + powershell_exec(build_powershell_package_command("Find-Package '#{name}'"), timeout: new_resource.timeout).result end if version.empty? version = nil end + version = version.strip if version.respond_to?(:strip) versions.push(version) end versions @@ -99,13 +101,14 @@ class Chef version_list = [] new_resource.package_name.each_with_index do |name, index| version = if new_resource.version && !new_resource.version[index].nil? - powershell_exec(build_powershell_package_command("Get-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result.strip + powershell_exec(build_powershell_package_command("Get-Package '#{name}'", new_resource.version[index]), timeout: new_resource.timeout).result else - powershell_exec(build_powershell_package_command("Get-Package '#{name}'"), timeout: new_resource.timeout).result.strip + powershell_exec(build_powershell_package_command("Get-Package '#{name}'"), timeout: new_resource.timeout).result end if version.empty? version = nil end + version = version.strip if version.respond_to?(:strip) version_list.push(version) end version_list -- cgit v1.2.1 From 821700b6b2f6d16de01170143665613757334b46 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Fri, 19 Nov 2021 16:07:22 +0000 Subject: Bump version to 17.8.8 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c686d16ee..cec5a22853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.7](https://github.com/chef/chef/tree/v17.8.7) (2021-11-17) + +## [v17.8.8](https://github.com/chef/chef/tree/v17.8.8) (2021-11-19) #### Merged Pull Requests -- fix dpkg_package doesn't do version comparisons on upgrade [#11970](https://github.com/chef/chef/pull/11970) ([snehaldwivedi](https://github.com/snehaldwivedi)) +- Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) - fix dpkg_package doesn't do version comparisons on upgrade [#11970](https://github.com/chef/chef/pull/11970) ([snehaldwivedi](https://github.com/snehaldwivedi)) - Implement compliance phase interval runs [#12226](https://github.com/chef/chef/pull/12226) ([lamont-granquist](https://github.com/lamont-granquist)) - fix invalid ffi type error after coerce in macos_userdefaults [#12234](https://github.com/chef/chef/pull/12234) ([rishichawda](https://github.com/rishichawda)) diff --git a/Gemfile.lock b/Gemfile.lock index f1343ebff9..f0495f38e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.7) + chef (17.8.8) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.7) - chef-utils (= 17.8.7) + chef-config (= 17.8.8) + chef-utils (= 17.8.8) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.7-universal-mingw32) + chef (17.8.8-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.7) - chef-utils (= 17.8.7) + chef-config (= 17.8.8) + chef-utils (= 17.8.8) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.7) - chef (= 17.8.7) + chef-bin (17.8.8) + chef (= 17.8.8) PATH remote: chef-config specs: - chef-config (17.8.7) + chef-config (17.8.8) addressable - chef-utils (= 17.8.7) + chef-utils (= 17.8.8) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.7) + chef-utils (17.8.8) concurrent-ruby GEM diff --git a/VERSION b/VERSION index e91d411acf..c8ab9e4dbd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.7 \ No newline at end of file +17.8.8 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 3bbf2684a5..1a35d5dc68 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.7".freeze + VERSION = "17.8.8".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index d517f5666f..0dbd7b82fe 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.7".freeze + VERSION = "17.8.8".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 90c4b53c32..70c64ef445 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.7" + VERSION = "17.8.8" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 58d3ba3725..8cfda2dfc0 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.7".freeze + VERSION = "17.8.8".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index ab1d551e75..212c747b1c 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.7") + VERSION = Chef::VersionString.new("17.8.8") end # -- cgit v1.2.1 From fafe11cd75c8effb9caf2fdbbd7575a6e92088a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:34:29 +0000 Subject: Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus Bumps [kitchen-vagrant](https://github.com/opscode/kitchen-vagrant) from 1.10.0 to 1.11.0. - [Release notes](https://github.com/opscode/kitchen-vagrant/releases) - [Changelog](https://github.com/test-kitchen/kitchen-vagrant/blob/master/CHANGELOG.md) - [Commits](https://github.com/opscode/kitchen-vagrant/compare/v1.10.0...v1.11.0) --- updated-dependencies: - dependency-name: kitchen-vagrant dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- omnibus/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index aaf22c7c2a..a1eac48d31 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -240,7 +240,7 @@ GEM iso8601 (0.13.0) jmespath (1.4.0) json (2.6.1) - kitchen-vagrant (1.10.0) + kitchen-vagrant (1.11.0) test-kitchen (>= 1.4, < 4) libyajl2 (2.1.0) license-acceptance (2.1.13) -- cgit v1.2.1 From dd484f2f00623b84c2e47542aeebec2450e0b5e2 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 23 Nov 2021 20:01:56 +0000 Subject: Bump version to 17.8.9 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 24 ++++++++++++------------ VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cec5a22853..a0414a283e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.8](https://github.com/chef/chef/tree/v17.8.8) (2021-11-19) + +## [v17.8.9](https://github.com/chef/chef/tree/v17.8.9) (2021-11-23) #### Merged Pull Requests -- Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) +- Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) - fix dpkg_package doesn't do version comparisons on upgrade [#11970](https://github.com/chef/chef/pull/11970) ([snehaldwivedi](https://github.com/snehaldwivedi)) - Implement compliance phase interval runs [#12226](https://github.com/chef/chef/pull/12226) ([lamont-granquist](https://github.com/lamont-granquist)) diff --git a/Gemfile.lock b/Gemfile.lock index f0495f38e0..6043be0a3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.8) + chef (17.8.9) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.8) - chef-utils (= 17.8.8) + chef-config (= 17.8.9) + chef-utils (= 17.8.9) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.8-universal-mingw32) + chef (17.8.9-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.8) - chef-utils (= 17.8.8) + chef-config (= 17.8.9) + chef-utils (= 17.8.9) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.8) - chef (= 17.8.8) + chef-bin (17.8.9) + chef (= 17.8.9) PATH remote: chef-config specs: - chef-config (17.8.8) + chef-config (17.8.9) addressable - chef-utils (= 17.8.8) + chef-utils (= 17.8.9) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.8) + chef-utils (17.8.9) concurrent-ruby GEM @@ -142,7 +142,7 @@ GEM mixlib-shellout (>= 2.0, < 4.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.533.0) + aws-partitions (1.534.0) aws-sdk-core (3.122.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) diff --git a/VERSION b/VERSION index c8ab9e4dbd..02b630a772 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.8 \ No newline at end of file +17.8.9 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 1a35d5dc68..980243c11d 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.8".freeze + VERSION = "17.8.9".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 0dbd7b82fe..e0831bb96a 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.8".freeze + VERSION = "17.8.9".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 70c64ef445..f3258e17b6 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.8" + VERSION = "17.8.9" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 8cfda2dfc0..a398cb428b 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.8".freeze + VERSION = "17.8.9".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 212c747b1c..c8ab8ed260 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.8") + VERSION = Chef::VersionString.new("17.8.9") end # -- cgit v1.2.1 From 41c21f4b1f7d77d2cb2ec1cfcd5b4d8d12826a66 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 23 Nov 2021 20:06:29 +0000 Subject: Bump version to 17.8.10 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0414a283e..6052737c93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.9](https://github.com/chef/chef/tree/v17.8.9) (2021-11-23) + +## [v17.8.10](https://github.com/chef/chef/tree/v17.8.10) (2021-11-23) #### Merged Pull Requests -- Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) +- Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) - fix dpkg_package doesn't do version comparisons on upgrade [#11970](https://github.com/chef/chef/pull/11970) ([snehaldwivedi](https://github.com/snehaldwivedi)) diff --git a/Gemfile.lock b/Gemfile.lock index 6043be0a3e..12d915d813 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.9) + chef (17.8.10) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.9) - chef-utils (= 17.8.9) + chef-config (= 17.8.10) + chef-utils (= 17.8.10) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.9-universal-mingw32) + chef (17.8.10-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.9) - chef-utils (= 17.8.9) + chef-config (= 17.8.10) + chef-utils (= 17.8.10) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.9) - chef (= 17.8.9) + chef-bin (17.8.10) + chef (= 17.8.10) PATH remote: chef-config specs: - chef-config (17.8.9) + chef-config (17.8.10) addressable - chef-utils (= 17.8.9) + chef-utils (= 17.8.10) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.9) + chef-utils (17.8.10) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 02b630a772..1984d84a09 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.9 \ No newline at end of file +17.8.10 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 980243c11d..0d52c302ce 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.9".freeze + VERSION = "17.8.10".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index e0831bb96a..2481db6e37 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.9".freeze + VERSION = "17.8.10".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index f3258e17b6..fc15e7a21c 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.9" + VERSION = "17.8.10" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index a398cb428b..54a2ce6a76 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.9".freeze + VERSION = "17.8.10".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index c8ab8ed260..86a6d03737 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.9") + VERSION = Chef::VersionString.new("17.8.10") end # -- cgit v1.2.1 From 8c2ae30e120b4cd4b370c573428602c221e5360a Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 23 Nov 2021 20:11:18 +0000 Subject: Bump version to 17.8.11 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 26 +++++++++++++------------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6052737c93..ce21173b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.10](https://github.com/chef/chef/tree/v17.8.10) (2021-11-23) + +## [v17.8.11](https://github.com/chef/chef/tree/v17.8.11) (2021-11-23) #### Merged Pull Requests -- Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) +- Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump inspec-core-bin to 4.50.3 [#12297](https://github.com/chef/chef/pull/12297) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index 12d915d813..d0fa3f48f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.10) + chef (17.8.11) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.10) - chef-utils (= 17.8.10) + chef-config (= 17.8.11) + chef-utils (= 17.8.11) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.10-universal-mingw32) + chef (17.8.11-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.10) - chef-utils (= 17.8.10) + chef-config (= 17.8.11) + chef-utils (= 17.8.11) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.10) - chef (= 17.8.10) + chef-bin (17.8.11) + chef (= 17.8.11) PATH remote: chef-config specs: - chef-config (17.8.10) + chef-config (17.8.11) addressable - chef-utils (= 17.8.10) + chef-utils (= 17.8.11) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.10) + chef-utils (17.8.11) concurrent-ruby GEM @@ -143,7 +143,7 @@ GEM ast (2.4.2) aws-eventstream (1.2.0) aws-partitions (1.534.0) - aws-sdk-core (3.122.1) + aws-sdk-core (3.123.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -151,7 +151,7 @@ GEM aws-sdk-kms (1.51.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.106.0) + aws-sdk-s3 (1.107.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) diff --git a/VERSION b/VERSION index 1984d84a09..c1da6882a9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.10 \ No newline at end of file +17.8.11 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 0d52c302ce..bc2ca4efa8 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.10".freeze + VERSION = "17.8.11".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 2481db6e37..c469bfb7b8 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.10".freeze + VERSION = "17.8.11".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index fc15e7a21c..01f4ecd72a 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.10" + VERSION = "17.8.11" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 54a2ce6a76..69903f5174 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.10".freeze + VERSION = "17.8.11".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 86a6d03737..659824b150 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.10") + VERSION = Chef::VersionString.new("17.8.11") end # -- cgit v1.2.1 From 0c7b6f1730a8b5eedbefad6e3c1a7ec6dcbf8c2f Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 23 Nov 2021 20:47:53 +0000 Subject: Bump version to 17.8.12 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce21173b35..9a8b075f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.11](https://github.com/chef/chef/tree/v17.8.11) (2021-11-23) + +## [v17.8.12](https://github.com/chef/chef/tree/v17.8.12) (2021-11-23) #### Merged Pull Requests -- Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) +- Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) ### Changes not yet released to stable #### Merged Pull Requests +- Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump omnibus-software from `32876cd` to `7501e20` in /omnibus [#12294](https://github.com/chef/chef/pull/12294) ([dependabot[bot]](https://github.com/dependabot[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index d0fa3f48f6..daa3c796f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.11) + chef (17.8.12) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.11) - chef-utils (= 17.8.11) + chef-config (= 17.8.12) + chef-utils (= 17.8.12) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.11-universal-mingw32) + chef (17.8.12-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.11) - chef-utils (= 17.8.11) + chef-config (= 17.8.12) + chef-utils (= 17.8.12) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.11) - chef (= 17.8.11) + chef-bin (17.8.12) + chef (= 17.8.12) PATH remote: chef-config specs: - chef-config (17.8.11) + chef-config (17.8.12) addressable - chef-utils (= 17.8.11) + chef-utils (= 17.8.12) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.11) + chef-utils (17.8.12) concurrent-ruby GEM diff --git a/VERSION b/VERSION index c1da6882a9..43fedbe518 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.11 \ No newline at end of file +17.8.12 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index bc2ca4efa8..cfb6de4e0d 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.11".freeze + VERSION = "17.8.12".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index c469bfb7b8..bd5ef0ebaa 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.11".freeze + VERSION = "17.8.12".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 01f4ecd72a..db0a2fae06 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.11" + VERSION = "17.8.12" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 69903f5174..eb7b2c7e44 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.11".freeze + VERSION = "17.8.12".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 659824b150..8c56d6ff23 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.11") + VERSION = Chef::VersionString.new("17.8.12") end # -- cgit v1.2.1 From 42f707b3418758a9b4c42a378c0824439efba695 Mon Sep 17 00:00:00 2001 From: Mike van Goor Date: Wed, 24 Nov 2021 09:46:45 +0100 Subject: Add the data collector config items for the use case the chef infra server cannot talk to automate or running chef solo Signed-off-by: Mike van Goor --- lib/chef/resource/chef_client_config.rb | 21 ++++++++++++++++++++- lib/chef/resource/support/client.erb | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb index bd4ccbc478..aa42bee862 100644 --- a/lib/chef/resource/chef_client_config.rb +++ b/lib/chef/resource/chef_client_config.rb @@ -87,6 +87,17 @@ class Chef ] end ``` + + **Report directly to the [Chef Automate data collector endpoint](/automate/data_collection/#configure-chef-infra-client-to-use-the-data-collector-endpoint-in-chef-automate).** + + ```ruby + chef_client_config 'Create client.rb' do + chef_server_url 'https://chef.example.dmz' + data_collector_server_url 'https://automate.example.dmz' + data_collector_token 'TEST_TOKEN_TEST' + end + ``` + DOC # @todo policy_file or policy_group being set requires the other to be set so enforce that. @@ -231,6 +242,12 @@ class Chef property :additional_config, String, description: "Additional text to add at the bottom of the client.rb config. This can be used to run custom Ruby or to add less common config options" + property :data_collector_server_url, String, + description: "The data collector url (typically automate) to send node, converge and compliance data. Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes." + + property :data_collector_token, String, + description: "The data collector token to interact with the data collector server url (Automate). Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes." + action :create, description: "Create a client.rb config file for configuring #{ChefUtils::Dist::Infra::PRODUCT}." do unless ::Dir.exist?(new_resource.config_directory) directory new_resource.config_directory do @@ -282,7 +299,9 @@ class Chef ssl_verify_mode: new_resource.ssl_verify_mode, start_handlers: format_handler(new_resource.start_handlers), additional_config: new_resource.additional_config, - policy_persist_run_list: new_resource.policy_persist_run_list + policy_persist_run_list: new_resource.policy_persist_run_list, + data_collector_server_url: new_resource.data_collector_server_url, + data_collector_token: new_resource.data_collector_token ) mode "0640" action :create diff --git a/lib/chef/resource/support/client.erb b/lib/chef/resource/support/client.erb index 0a0db02249..8e96ca49e2 100644 --- a/lib/chef/resource/support/client.erb +++ b/lib/chef/resource/support/client.erb @@ -37,6 +37,13 @@ log_location <%= @log_location %> log_location <%= @log_location.inspect %> <% end -%> <% end -%> +<%# These data_collector options are special as they have a '.' -%> +<% unless @data_collector_server_url.nil? || @data_collector_server_url.empty? %> +data_collector.server_url <%= @data_collector_server_url %> +<% end %> +<% unless @data_collector_token.nil? || @data_collector_token.empty? %> +data_collector.token <%= @data_collector_token %> +<% end %> <%# The code below is not DRY on purpose to improve readability -%> <% unless @start_handlers.empty? -%> # Do not crash if a start handler is missing / not installed yet -- cgit v1.2.1 From 3b266b13dcbb5f81c6c1dcd72b3c944fd34b80b6 Mon Sep 17 00:00:00 2001 From: rishichawda Date: Wed, 24 Nov 2021 17:11:25 +0530 Subject: add kitchen tests for powershell package resource Signed-off-by: rishichawda --- .../cookbooks/end_to_end/recipes/_powershell_package.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 kitchen-tests/cookbooks/end_to_end/recipes/_powershell_package.rb diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_powershell_package.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_powershell_package.rb new file mode 100644 index 0000000000..ba40b39794 --- /dev/null +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_powershell_package.rb @@ -0,0 +1,10 @@ +powershell_package "PSReadline" + +powershell_package "multi package install" do + package_name %w{PSReadline chocolatey} +end + +powershell_package "remove all packages" do + package_name %w{PSReadline chocolatey} + action :remove +end -- cgit v1.2.1 From 32caaaceb1d964f71cbf2e6d3355d4a67ae1833d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Nov 2021 14:19:47 +0000 Subject: Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus Bumps [omnibus-software](https://github.com/chef/omnibus-software) from `7501e20` to `461fc3e`. - [Release notes](https://github.com/chef/omnibus-software/releases) - [Commits](https://github.com/chef/omnibus-software/compare/7501e2036a654e4918e9fffd8ee6ef69f3b7f633...461fc3e9f0a8f2f13e73b45413d232bfd04390aa) --- updated-dependencies: - dependency-name: omnibus-software dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- omnibus/Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 54cc7abc69..b5a5edc60b 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/chef/omnibus-software.git - revision: 7501e2036a654e4918e9fffd8ee6ef69f3b7f633 + revision: 461fc3e9f0a8f2f13e73b45413d232bfd04390aa branch: main specs: omnibus-software (4.0.0) @@ -33,8 +33,8 @@ GEM artifactory (3.0.15) awesome_print (1.9.2) aws-eventstream (1.2.0) - aws-partitions (1.531.0) - aws-sdk-core (3.122.1) + aws-partitions (1.534.0) + aws-sdk-core (3.123.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -42,7 +42,7 @@ GEM aws-sdk-kms (1.51.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.105.1) + aws-sdk-s3 (1.107.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) -- cgit v1.2.1 From aa9af2e06e48a782780be3086b88768839cea9b1 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Sat, 27 Nov 2021 04:14:08 +0000 Subject: Bump version to 17.8.13 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a8b075f1b..06753fb9d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.12](https://github.com/chef/chef/tree/v17.8.12) (2021-11-23) + +## [v17.8.13](https://github.com/chef/chef/tree/v17.8.13) (2021-11-27) #### Merged Pull Requests -- Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) +- Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) - Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) - Bump test-kitchen from 3.1.1 to 3.2.0 in /omnibus [#12296](https://github.com/chef/chef/pull/12296) ([dependabot[bot]](https://github.com/dependabot[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index daa3c796f2..ba2fa0b5b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.12) + chef (17.8.13) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.12) - chef-utils (= 17.8.12) + chef-config (= 17.8.13) + chef-utils (= 17.8.13) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.12-universal-mingw32) + chef (17.8.13-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.12) - chef-utils (= 17.8.12) + chef-config (= 17.8.13) + chef-utils (= 17.8.13) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.12) - chef (= 17.8.12) + chef-bin (17.8.13) + chef (= 17.8.13) PATH remote: chef-config specs: - chef-config (17.8.12) + chef-config (17.8.13) addressable - chef-utils (= 17.8.12) + chef-utils (= 17.8.13) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.12) + chef-utils (17.8.13) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 43fedbe518..be31a6a66b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.12 \ No newline at end of file +17.8.13 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index cfb6de4e0d..b746fc79c9 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.12".freeze + VERSION = "17.8.13".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index bd5ef0ebaa..82306b40be 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.12".freeze + VERSION = "17.8.13".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index db0a2fae06..4e914ad55b 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.12" + VERSION = "17.8.13" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index eb7b2c7e44..3f5c83769a 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.12".freeze + VERSION = "17.8.13".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 8c56d6ff23..e0465a5b1e 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.12") + VERSION = Chef::VersionString.new("17.8.13") end # -- cgit v1.2.1 From 67d2b758098c576b8add0c6cbd6d4bbdb4ee81c2 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 26 Nov 2021 20:16:59 -0800 Subject: Add missing introduced fields in chef_client_config Make sure we properly generate documentation for this Signed-off-by: Tim Smith --- lib/chef/resource/chef_client_config.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb index aa42bee862..ed5f3b26a8 100644 --- a/lib/chef/resource/chef_client_config.rb +++ b/lib/chef/resource/chef_client_config.rb @@ -243,10 +243,12 @@ class Chef description: "Additional text to add at the bottom of the client.rb config. This can be used to run custom Ruby or to add less common config options" property :data_collector_server_url, String, - description: "The data collector url (typically automate) to send node, converge and compliance data. Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes." + description: "The data collector url (typically automate) to send node, converge and compliance data. Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes.", + introduced: "17.8" property :data_collector_token, String, - description: "The data collector token to interact with the data collector server url (Automate). Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes." + description: "The data collector token to interact with the data collector server url (Automate). Note: Data collection reporting to Automate should be performed directly by Chef Infra Server if possible, as this removes the need to distribute tokens to individual nodes.", + introduced: "17.8" action :create, description: "Create a client.rb config file for configuring #{ChefUtils::Dist::Infra::PRODUCT}." do unless ::Dir.exist?(new_resource.config_directory) -- cgit v1.2.1 From 1086520428843687e4ea442abc2fdfbe9aea2bf3 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Sat, 27 Nov 2021 04:18:58 +0000 Subject: Bump version to 17.8.14 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06753fb9d6..763687f53b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.13](https://github.com/chef/chef/tree/v17.8.13) (2021-11-27) + +## [v17.8.14](https://github.com/chef/chef/tree/v17.8.14) (2021-11-27) #### Merged Pull Requests -- Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) +- Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) ### Changes not yet released to stable #### Merged Pull Requests +- Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) - Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) - Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump kitchen-vagrant from 1.10.0 to 1.11.0 in /omnibus [#12307](https://github.com/chef/chef/pull/12307) ([dependabot[bot]](https://github.com/dependabot[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index ba2fa0b5b4..2bd0c76183 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.13) + chef (17.8.14) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.13) - chef-utils (= 17.8.13) + chef-config (= 17.8.14) + chef-utils (= 17.8.14) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.13-universal-mingw32) + chef (17.8.14-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.13) - chef-utils (= 17.8.13) + chef-config (= 17.8.14) + chef-utils (= 17.8.14) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.13) - chef (= 17.8.13) + chef-bin (17.8.14) + chef (= 17.8.14) PATH remote: chef-config specs: - chef-config (17.8.13) + chef-config (17.8.14) addressable - chef-utils (= 17.8.13) + chef-utils (= 17.8.14) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.13) + chef-utils (17.8.14) concurrent-ruby GEM diff --git a/VERSION b/VERSION index be31a6a66b..92d7687a8d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.13 \ No newline at end of file +17.8.14 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index b746fc79c9..5c840b949b 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.13".freeze + VERSION = "17.8.14".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 82306b40be..a1e62f9ab6 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.13".freeze + VERSION = "17.8.14".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 4e914ad55b..47ae5f3b59 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.13" + VERSION = "17.8.14" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 3f5c83769a..175c92d9a8 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.13".freeze + VERSION = "17.8.14".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index e0465a5b1e..9710cb8549 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.13") + VERSION = Chef::VersionString.new("17.8.14") end # -- cgit v1.2.1 From b58bb1ab988b6f2ba69233d9d9a7505ccf9f3288 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 29 Nov 2021 16:07:11 -0800 Subject: Rubygems 3.2.x spec fixes Needed for ruby-3.0.3 Signed-off-by: Lamont Granquist --- spec/unit/provider/package/rubygems_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index 6ef63d3961..a4ffc1712e 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -410,6 +410,9 @@ describe Chef::Provider::Package::Rubygems do # Rubygems uses these two interally allow(RbConfig::CONFIG).to receive(:[]).with("arch").and_call_original allow(RbConfig::CONFIG).to receive(:[]).with("ruby_install_name").and_call_original + allow(RbConfig::CONFIG).to receive(:[]).with("ruby_version").and_call_original + allow(RbConfig::CONFIG).to receive(:[]).with("rubylibprefix").and_call_original + allow(RbConfig::CONFIG).to receive(:[]).with("vendordir").and_call_original allow(File).to receive(:executable?).and_return false allow(File).to receive(:executable?).with("#{bindir}/gem").and_return true # XXX: we can't stub the provider object directly here because referencing it will create it and that -- cgit v1.2.1 From 8c77b40ded402a3630ca67dadf5409ccb06131b7 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 01:21:59 +0000 Subject: Bump version to 17.8.15 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- Gemfile.lock | 26 +++++++++++++------------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2bd0c76183..ee09ea2d61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.14) + chef (17.8.15) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.14) - chef-utils (= 17.8.14) + chef-config (= 17.8.15) + chef-utils (= 17.8.15) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.14-universal-mingw32) + chef (17.8.15-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.14) - chef-utils (= 17.8.14) + chef-config (= 17.8.15) + chef-utils (= 17.8.15) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.14) - chef (= 17.8.14) + chef-bin (17.8.15) + chef (= 17.8.15) PATH remote: chef-config specs: - chef-config (17.8.14) + chef-config (17.8.15) addressable - chef-utils (= 17.8.14) + chef-utils (= 17.8.15) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.14) + chef-utils (17.8.15) concurrent-ruby GEM @@ -142,7 +142,7 @@ GEM mixlib-shellout (>= 2.0, < 4.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.534.0) + aws-partitions (1.536.0) aws-sdk-core (3.123.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -151,7 +151,7 @@ GEM aws-sdk-kms (1.51.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.107.0) + aws-sdk-s3 (1.108.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) diff --git a/VERSION b/VERSION index 92d7687a8d..0175d258b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.14 \ No newline at end of file +17.8.15 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 5c840b949b..6d813ccdf3 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.14".freeze + VERSION = "17.8.15".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index a1e62f9ab6..5e80279c5a 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.14".freeze + VERSION = "17.8.15".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 47ae5f3b59..93cc713136 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.14" + VERSION = "17.8.15" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 175c92d9a8..ac3f9de249 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.14".freeze + VERSION = "17.8.15".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 9710cb8549..3192b0027b 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.14") + VERSION = Chef::VersionString.new("17.8.15") end # -- cgit v1.2.1 From bfff9818248e99c59763bd858cfd862b969fdd1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 01:27:10 +0000 Subject: Bump omnibus-software from `461fc3e` to `8560231` in /omnibus Bumps [omnibus-software](https://github.com/chef/omnibus-software) from `461fc3e` to `8560231`. - [Release notes](https://github.com/chef/omnibus-software/releases) - [Commits](https://github.com/chef/omnibus-software/compare/461fc3e9f0a8f2f13e73b45413d232bfd04390aa...85602312dd75745571728606c3ef77faabddf1d9) --- updated-dependencies: - dependency-name: omnibus-software dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- omnibus/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index b5a5edc60b..6ed662f62e 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/chef/omnibus-software.git - revision: 461fc3e9f0a8f2f13e73b45413d232bfd04390aa + revision: 85602312dd75745571728606c3ef77faabddf1d9 branch: main specs: omnibus-software (4.0.0) @@ -33,7 +33,7 @@ GEM artifactory (3.0.15) awesome_print (1.9.2) aws-eventstream (1.2.0) - aws-partitions (1.534.0) + aws-partitions (1.536.0) aws-sdk-core (3.123.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -42,7 +42,7 @@ GEM aws-sdk-kms (1.51.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.107.0) + aws-sdk-s3 (1.108.0) aws-sdk-core (~> 3, >= 3.122.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) -- cgit v1.2.1 From d048b20521db2ca8ac9bc11c425a7631b6dd6215 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 29 Nov 2021 17:29:55 -0800 Subject: Ruby 3.0.3 And a bundle update Signed-off-by: Lamont Granquist --- Gemfile.lock | 4 ++-- omnibus/Gemfile.lock | 24 ++++++++++++------------ omnibus_overrides.rb | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ee09ea2d61..43eb82e577 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -290,7 +290,7 @@ GEM net-ssh (6.1.0) nori (2.6.0) parallel (1.21.0) - parser (3.0.2.0) + parser (3.0.3.1) ast (~> 2.4.1) parslet (1.8.2) pastel (0.8.0) @@ -466,4 +466,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.2.22 + 2.2.32 diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 6ed662f62e..1acbb12fd9 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -65,12 +65,12 @@ GEM solve (~> 4.0) thor (>= 0.20) builder (3.2.4) - chef (16.16.13) + chef (16.17.4) addressable bcrypt_pbkdf (~> 1.1) bundler (>= 1.10) - chef-config (= 16.16.13) - chef-utils (= 16.16.13) + chef-config (= 16.17.4) + chef-utils (= 16.17.4) chef-vault chef-zero (>= 14.0.11) diff-lcs (>= 1.2.4, < 1.4.0) @@ -102,12 +102,12 @@ GEM tty-screen (~> 0.6) tty-table (~> 0.11) uuidtools (>= 2.1.5, < 3.0) - chef (16.16.13-universal-mingw32) + chef (16.17.4-universal-mingw32) addressable bcrypt_pbkdf (~> 1.1) bundler (>= 1.10) - chef-config (= 16.16.13) - chef-utils (= 16.16.13) + chef-config (= 16.17.4) + chef-utils (= 16.17.4) chef-vault chef-zero (>= 14.0.11) diff-lcs (>= 1.2.4, < 1.4.0) @@ -151,9 +151,9 @@ GEM win32-taskscheduler (~> 2.0) wmi-lite (~> 1.0) chef-cleanroom (1.0.4) - chef-config (16.16.13) + chef-config (16.17.4) addressable - chef-utils (= 16.16.13) + chef-utils (= 16.17.4) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -161,7 +161,7 @@ GEM chef-telemetry (1.1.1) chef-config concurrent-ruby (~> 1.0) - chef-utils (16.16.13) + chef-utils (16.17.4) chef-vault (4.1.4) chef-zero (15.0.11) ffi-yajl (~> 2.2) @@ -212,7 +212,7 @@ GEM highline (2.0.3) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.49.0) + inspec-core (4.50.3) addressable (~> 2.4) chef-telemetry (~> 1.0, >= 1.0.8) faraday (>= 0.9.0, < 1.5) @@ -363,7 +363,7 @@ GEM strings-ansi (0.2.0) structured_warnings (0.4.0) syslog-logger (1.6.8) - test-kitchen (3.2.0) + test-kitchen (3.2.1) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -478,4 +478,4 @@ DEPENDENCIES winrm-fs (~> 1.0) BUNDLED WITH - 2.2.22 + 2.2.32 diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index 59979f2703..ee21ae5713 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -16,8 +16,8 @@ override "ncurses", version: "5.9" override "nokogiri", version: "1.11.0" override "openssl", version: mac_os_x? ? "1.1.1l" : "1.0.2zb" override "pkg-config-lite", version: "0.28-1" -override "bundler", version: "2.2.22" -override "ruby", version: "3.0.2" +override "bundler", version: "2.2.32" +override "ruby", version: "3.0.3" override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18" override "util-macros", version: "1.19.0" override "xproto", version: "7.0.28" -- cgit v1.2.1 From 9eec7706fc7140e1611cb8b2d309e53dc352b275 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 01:31:40 +0000 Subject: Bump version to 17.8.16 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 763687f53b..de7eae7423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.14](https://github.com/chef/chef/tree/v17.8.14) (2021-11-27) + +## [v17.8.16](https://github.com/chef/chef/tree/v17.8.16) (2021-11-30) #### Merged Pull Requests -- Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) +- Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) ### Changes not yet released to stable #### Merged Pull Requests +- Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) - Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) - Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) - Do not run assertions for actions that are not being executed [#12282](https://github.com/chef/chef/pull/12282) ([lamont-granquist](https://github.com/lamont-granquist)) diff --git a/Gemfile.lock b/Gemfile.lock index ee09ea2d61..66099f8aff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.15) + chef (17.8.16) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.15) - chef-utils (= 17.8.15) + chef-config (= 17.8.16) + chef-utils (= 17.8.16) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.15-universal-mingw32) + chef (17.8.16-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.15) - chef-utils (= 17.8.15) + chef-config (= 17.8.16) + chef-utils (= 17.8.16) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.15) - chef (= 17.8.15) + chef-bin (17.8.16) + chef (= 17.8.16) PATH remote: chef-config specs: - chef-config (17.8.15) + chef-config (17.8.16) addressable - chef-utils (= 17.8.15) + chef-utils (= 17.8.16) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.15) + chef-utils (17.8.16) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 0175d258b0..556f42aed8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.15 \ No newline at end of file +17.8.16 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 6d813ccdf3..3d28e9db51 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.15".freeze + VERSION = "17.8.16".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 5e80279c5a..ae7e1610c1 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.15".freeze + VERSION = "17.8.16".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 93cc713136..2d1086a4e9 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.15" + VERSION = "17.8.16" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index ac3f9de249..988f9673ce 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.15".freeze + VERSION = "17.8.16".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 3192b0027b..024fee4627 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.15") + VERSION = Chef::VersionString.new("17.8.16") end # -- cgit v1.2.1 From f1056e53b346dfe2da5005fd423750977c225a11 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 01:36:30 +0000 Subject: Bump version to 17.8.17 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de7eae7423..f82d1bb07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.16](https://github.com/chef/chef/tree/v17.8.16) (2021-11-30) + +## [v17.8.17](https://github.com/chef/chef/tree/v17.8.17) (2021-11-30) #### Merged Pull Requests -- Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) +- Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) ### Changes not yet released to stable #### Merged Pull Requests +- Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) - Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) - Bump omnibus-software from `7501e20` to `461fc3e` in /omnibus [#12313](https://github.com/chef/chef/pull/12313) ([dependabot[bot]](https://github.com/dependabot[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index 437014872e..741ae72c91 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.16) + chef (17.8.17) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.16) - chef-utils (= 17.8.16) + chef-config (= 17.8.17) + chef-utils (= 17.8.17) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.16-universal-mingw32) + chef (17.8.17-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.16) - chef-utils (= 17.8.16) + chef-config (= 17.8.17) + chef-utils (= 17.8.17) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.16) - chef (= 17.8.16) + chef-bin (17.8.17) + chef (= 17.8.17) PATH remote: chef-config specs: - chef-config (17.8.16) + chef-config (17.8.17) addressable - chef-utils (= 17.8.16) + chef-utils (= 17.8.17) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.16) + chef-utils (17.8.17) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 556f42aed8..86780a81be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.16 \ No newline at end of file +17.8.17 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 3d28e9db51..72a8ae9eda 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.16".freeze + VERSION = "17.8.17".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index ae7e1610c1..8cfe6bfc11 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.16".freeze + VERSION = "17.8.17".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 2d1086a4e9..a25e94b142 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.16" + VERSION = "17.8.17" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 988f9673ce..0fb3697615 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.16".freeze + VERSION = "17.8.17".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 024fee4627..369517f165 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.16") + VERSION = Chef::VersionString.new("17.8.17") end # -- cgit v1.2.1 From 5496dc736fb28687902daa8a23705c6f234599fa Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 29 Nov 2021 22:27:32 -0800 Subject: Add allow_downgrade back to DNF Signed-off-by: Lamont Granquist --- cspell.json | 5 ++ lib/chef/provider/package.rb | 81 ++++++++++++++++++++-------- lib/chef/provider/package/dnf.rb | 2 +- lib/chef/resource/dnf_package.rb | 10 ++-- omnibus/.tool-versions | 1 + spec/functional/resource/dnf_package_spec.rb | 54 ++++++++++++------- 6 files changed, 103 insertions(+), 50 deletions(-) create mode 100644 omnibus/.tool-versions diff --git a/cspell.json b/cspell.json index 06118297c8..72474a7fbc 100644 --- a/cspell.json +++ b/cspell.json @@ -181,6 +181,8 @@ "CNAME", "cname", "codepage", + "codepath", + "codepaths", "CODESEG", "COLORINDEX", "COLORREF", @@ -1338,6 +1340,9 @@ "unintuitive", "unixy", "Unjoin", + "unlazies", + "unlazied", + "unlazying", "Unmanaged", "unmanaged", "unmerge", diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index 65d2254258..82d7ed00cf 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -438,47 +438,81 @@ class Chef @target_version_array ||= begin target_version_array = [] - each_package do |package_name, new_version, current_version, candidate_version| + each_package do |package_name, new_version, current_version, candidate_version, magic_version| case action when :upgrade - if current_version.nil? - # with use_magic_version there may be a package installed, but it fails the user's - # requested new_resource.version constraints + if version_equals?(current_version, new_version) + # This is a short-circuit (mostly for the rubygems provider) to avoid needing to + # expensively query the candidate_version which must come later. This only checks + # exact matching, the check for fuzzy matching is later. + logger.trace("#{new_resource} #{package_name} #{new_version} is already installed") + target_version_array.push(nil) + elsif current_version.nil? + # This is a simple check to see if we have any currently installed version at all, this is + # safe to do before the allow_downgrade check so we check this before. logger.trace("#{new_resource} has no existing installed version. Installing install #{candidate_version}") target_version_array.push(candidate_version) - elsif !use_magic_version? && version_equals?(current_version, new_version) - # this is a short-circuit (mostly for the rubygems provider) to avoid needing to expensively query the candidate_version which must come later - logger.trace("#{new_resource} #{package_name} #{new_version} is already installed") + elsif !allow_downgrade && version_compare(current_version, candidate_version) == 1 + # This check for downgrading when allow_downgrade is false uses the current_version rather + # than the magic_version since we never want to downgrade even if the constraints are not met + # if the version is higher. This check does use the candidate_version and unlazies this so + # there will a perf hit on idempotent use when allow_downgrade is false which is unavoidable. + logger.trace("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{candidate_version}. Skipping...)") target_version_array.push(nil) + elsif magic_version.nil? + # This is the check for fuzzy matching of the installed_version, where if the installed version + # does not match the desired version constraints (but is not an exact match) then we need to + # install the candidate_version (this must come after the allow_downgrade check) + logger.trace("#{new_resource} has an installed version that does not match the version constraint. Installing install #{candidate_version}") + target_version_array.push(candidate_version) elsif candidate_version.nil? + # This check necessarily unlazies the candidate_version and may be expensive (connecting to + # rubygems.org or whatever). It comes as late as possible. logger.trace("#{new_resource} #{package_name} has no candidate_version to upgrade to") target_version_array.push(nil) elsif version_equals?(current_version, candidate_version) + # This check sees if the candidate_version is already installed or if we should upgrade/update the + # package. This is the normal idempotent behavior of :upgrade and is inherently expensive due to + # unlazying the candidate_version. To prevent the perf hit the version may be specified with a full + # version constraint. Then the cookbook can roll the version forward and use :upgrade to force version + # pinning. logger.trace("#{new_resource} #{package_name} #{candidate_version} is already installed") target_version_array.push(nil) - elsif !allow_downgrade && version_compare(current_version, candidate_version) == 1 - logger.trace("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{candidate_version}. Skipping...)") - target_version_array.push(nil) else - logger.trace("#{new_resource} #{package_name} is out of date, will upgrade to #{candidate_version}") + logger.trace("#{new_resource} #{package_name} is out of date, will update to #{candidate_version}") target_version_array.push(candidate_version) end when :install - if new_version && !use_magic_version? + if current_version && new_version && !allow_downgrade && version_compare(current_version, new_version) == 1 + # This is the idempotency guard for downgrades when downgrades are not allowed. This should perhaps raise + # an exception since we were told to install an exact package version but we are silently refusing to do so + # because a higher version is already installed. Maybe we need a flag for users to apply their preferred + # declarative philosophy? This has to come early and outside of the two code paths below. + logger.warn("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{new_version}. Skipping...)") + target_version_array.push(nil) + elsif new_version && !use_magic_version? + # This is for "non magic version using" subclasses to do comparisons between the current_version and the + # desired new_version. XXX: If we converted this to current_version_requirement_satisfied? and made it specific + # to the current version check and then eliminated the magic_version, we might be able to eliminate separate codepaths + # here, and eliminate the semantic confusion around the magic_version? if version_requirement_satisfied?(current_version, new_version) logger.trace("#{new_resource} #{package_name} #{current_version} satisfies #{new_version} requirement") target_version_array.push(nil) - elsif current_version && !allow_downgrade && version_compare(current_version, new_version) == 1 - logger.warn("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{new_version}. Skipping...)") - target_version_array.push(nil) else + # XXX: some subclasses seem to depend on this behavior where the new_version can be different from the + # candidate_version and we install the new_version, it seems like the candidate_version should be fixed to + # be resolved correctly to the new_version for those providers. although it may just be unit test bugs. + # it would be more correct to use the candidate_version here, but then it needs to be the correctly resolved + # candidate_version against the new_version constraint. logger.trace("#{new_resource} #{package_name} #{current_version} needs updating to #{new_version}") target_version_array.push(new_version) end - elsif current_version.nil? - # with use_magic_version there may be a package installed, but it fails the user's - # requested new_resource.version constraints + elsif magic_version.nil? + # This is for when we have a "magic version using" subclass and where the installed version does not match the + # constraint specified in the new_version, so we need to upgrade to the candidate_version. This is the only + # codepath in the :install branch which references the candidate_version so it is slow, but it is the path where + # we need to do work anyway. XXX: should we check for candidate_version.nil? somewhere around here? logger.trace("#{new_resource} #{package_name} not installed, installing #{candidate_version}") target_version_array.push(candidate_version) else @@ -512,8 +546,8 @@ class Chef @packages_missing_candidates ||= begin missing = [] - each_package do |package_name, new_version, current_version, candidate_version| - missing.push(package_name) if current_version.nil? && candidate_version.nil? + each_package do |package_name, new_version, current_version, candidate_version, magic_version| + missing.push(package_name) if magic_version.nil? && candidate_version.nil? end missing end @@ -536,7 +570,7 @@ class Chef @forced_packages_missing_candidates ||= begin missing = [] - each_package do |package_name, new_version, current_version, candidate_version| + each_package do |package_name, new_version, current_version, candidate_version, magic_version| next if new_version.nil? || current_version.nil? if use_magic_version? @@ -559,9 +593,10 @@ class Chef def each_package package_name_array.each_with_index do |package_name, i| candidate_version = candidate_version_array[i] - current_version = use_magic_version? ? magic_version[i] : current_version_array[i] + current_version = current_version_array[i] + magic_version = use_magic_version? ? magic_version_array[i] : current_version_array[i] new_version = new_version_array[i] - yield package_name, new_version, current_version, candidate_version + yield package_name, new_version, current_version, candidate_version, magic_version end end diff --git a/lib/chef/provider/package/dnf.rb b/lib/chef/provider/package/dnf.rb index 5c74ad0414..67bf24a411 100644 --- a/lib/chef/provider/package/dnf.rb +++ b/lib/chef/provider/package/dnf.rb @@ -98,7 +98,7 @@ class Chef end end - def magic_version + def magic_version_array package_name_array.each_with_index.map do |pkg, i| magical_version(i).version_with_arch end diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb index 80727de7d0..aad0192490 100644 --- a/lib/chef/resource/dnf_package.rb +++ b/lib/chef/resource/dnf_package.rb @@ -68,12 +68,10 @@ class Chef end } - def allow_downgrade(arg = nil) - unless arg.nil? - Chef.deprecated(:dnf_package_allow_downgrade, "the allow_downgrade property on the dnf_package provider is not used, DNF supports downgrades by default.") - end - true - end + property :allow_downgrade, [ TrueClass, FalseClass ], + description: "Allow downgrading a package to satisfy requested version requirements.", + default: true, + desired_state: false end end end diff --git a/omnibus/.tool-versions b/omnibus/.tool-versions new file mode 100644 index 0000000000..1ade73219b --- /dev/null +++ b/omnibus/.tool-versions @@ -0,0 +1 @@ +ruby 2.7.4 diff --git a/spec/functional/resource/dnf_package_spec.rb b/spec/functional/resource/dnf_package_spec.rb index 9e03db5123..35af5d5c1a 100644 --- a/spec/functional/resource/dnf_package_spec.rb +++ b/spec/functional/resource/dnf_package_spec.rb @@ -455,7 +455,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do end context "downgrades" do - it "downgrades the package when allow_downgrade" do + it "downgrades the package when allow_downgrade is true" do flush_cache preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package "chef_rpm" do @@ -470,6 +470,18 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do action :install end.should_not_be_updated end + + it "does not downgrade the package when allow_downgrade is false" do + flush_cache + preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") + dnf_package "chef_rpm" do + options default_options + allow_downgrade false + version "1.2-1" + action :install + end.should_not_be_updated + expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$") + end end context "with arches", :intel_64bit do @@ -763,6 +775,17 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do end.should_not_be_updated end + it "downgrade on a local file with allow_downgrade false does not downgrade" do + preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") + dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do + options default_options + allow_downgrade false + version "1.2-1" + action :install + end.should_not_be_updated + expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$") + end + it "does not downgrade the package with :install" do preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do @@ -1027,25 +1050,6 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do action :install end.should_not_be_updated end - - it "throws a deprecation warning with allow_downgrade" do - Chef::Config[:treat_deprecation_warnings_as_errors] = false - expect(Chef).to receive(:deprecated).at_least(:once).with(:dnf_package_allow_downgrade, /^the allow_downgrade property on the dnf_package provider is not used/) - preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") - dnf_package "chef_rpm" do - options default_options - version "1.2" - allow_downgrade true - action :install - end.should_be_updated - expect(shell_out("rpm -q chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}") - dnf_package "chef_rpm" do - options default_options - version "1.2" - allow_downgrade true - action :install - end.should_not_be_updated - end end context "with source arguments" do @@ -1092,6 +1096,16 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do end.should_not_be_updated end + it "does not downgrade the package when allow_downgrade is false" do + preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") + dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm" do + options default_options + allow_downgrade false + action :upgrade + end.should_not_be_updated + expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$") + end + it "upgrades the package" do preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm") dnf_package "#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.10-1.#{pkg_arch}.rpm" do -- cgit v1.2.1 From 1a3823919167ef6c22848ac2aa5ec0b1b291c0ab Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 06:31:27 +0000 Subject: Bump version to 17.8.18 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f82d1bb07f..ba18873b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.17](https://github.com/chef/chef/tree/v17.8.17) (2021-11-30) + +## [v17.8.18](https://github.com/chef/chef/tree/v17.8.18) (2021-11-30) #### Merged Pull Requests -- Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) +- Add allow_downgrade back to DNF [#12291](https://github.com/chef/chef/pull/12291) ([lamont-granquist](https://github.com/lamont-granquist)) ### Changes not yet released to stable #### Merged Pull Requests +- Add allow_downgrade back to DNF [#12291](https://github.com/chef/chef/pull/12291) ([lamont-granquist](https://github.com/lamont-granquist)) - Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) - Add data collector config items for infra config [#12292](https://github.com/chef/chef/pull/12292) ([mvangoor](https://github.com/mvangoor)) diff --git a/Gemfile.lock b/Gemfile.lock index 741ae72c91..94f9f51948 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.17) + chef (17.8.18) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.17) - chef-utils (= 17.8.17) + chef-config (= 17.8.18) + chef-utils (= 17.8.18) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.17-universal-mingw32) + chef (17.8.18-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.17) - chef-utils (= 17.8.17) + chef-config (= 17.8.18) + chef-utils (= 17.8.18) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.17) - chef (= 17.8.17) + chef-bin (17.8.18) + chef (= 17.8.18) PATH remote: chef-config specs: - chef-config (17.8.17) + chef-config (17.8.18) addressable - chef-utils (= 17.8.17) + chef-utils (= 17.8.18) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.17) + chef-utils (17.8.18) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 86780a81be..48b48bb773 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.17 \ No newline at end of file +17.8.18 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 72a8ae9eda..f080bbecd2 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.17".freeze + VERSION = "17.8.18".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 8cfe6bfc11..566a591659 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.17".freeze + VERSION = "17.8.18".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index a25e94b142..13b2991803 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.17" + VERSION = "17.8.18" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index 0fb3697615..fea71851fd 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.17".freeze + VERSION = "17.8.18".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 369517f165..b6653df3b2 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.17") + VERSION = Chef::VersionString.new("17.8.18") end # -- cgit v1.2.1 From 5fa2c7ffae1e5b235e2bc72eb3f4e63c531b43c9 Mon Sep 17 00:00:00 2001 From: smriti Date: Wed, 12 May 2021 18:30:11 +0530 Subject: Mount: resource with loop option not idempotent Signed-off-by: smriti --- cspell.json | 1 + lib/chef/provider/mount/linux.rb | 15 +++++++++++++-- lib/chef/provider/mount/mount.rb | 2 +- spec/unit/provider/mount/linux_spec.rb | 19 ++++++++++++++++--- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cspell.json b/cspell.json index 72474a7fbc..6f40be96c2 100644 --- a/cspell.json +++ b/cspell.json @@ -612,6 +612,7 @@ "listprop", "ljust", "lltstype", + "losetup", "LMEM", "LMSHARE", "LMSTR", diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb index 382e37d41a..43852e330b 100644 --- a/lib/chef/provider/mount/linux.rb +++ b/lib/chef/provider/mount/linux.rb @@ -29,10 +29,13 @@ class Chef # "findmnt" outputs the mount points with volume. # Convert the mount_point of the resource to a real path in case it # contains symlinks in its parents dirs. + def loop_mount_points + # get loop_mount_points only if not initialized earlier + @loop_mount_points ||= shell_out!("losetup -a").stdout + end def mounted? mounted = false - real_mount_point = if ::File.exists? @new_resource.mount_point ::File.realpath(@new_resource.mount_point) else @@ -45,6 +48,14 @@ class Chef when /\A#{Regexp.escape(real_mount_point)}\s+#{device_mount_regex}\s/ mounted = true logger.trace("Special device #{device_logstring} mounted as #{real_mount_point}") + # Permalink for loop type devices mount points https://rubular.com/r/a0bS4p2RvXsGxx + when %r{\A#{Regexp.escape(real_mount_point)}\s+\/dev\/loop+[0-9]+\s} + loop_mount_points.each_line do |mount_point| + if mount_point.include? device_real + mounted = true + break + end + end # Permalink for multiple devices mounted to the same mount point(i.e. '/proc') https://rubular.com/r/a356yzspU7N9TY when %r{\A#{Regexp.escape(real_mount_point)}\s+([/\w])+\s} mounted = false @@ -64,4 +75,4 @@ class Chef end end end -end +end \ No newline at end of file diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb index 802ee11c23..2bc9d2c78f 100644 --- a/lib/chef/provider/mount/mount.rb +++ b/lib/chef/provider/mount/mount.rb @@ -279,4 +279,4 @@ class Chef end end end -end +end \ No newline at end of file diff --git a/spec/unit/provider/mount/linux_spec.rb b/spec/unit/provider/mount/linux_spec.rb index 3e41f895d1..188777a19b 100644 --- a/spec/unit/provider/mount/linux_spec.rb +++ b/spec/unit/provider/mount/linux_spec.rb @@ -10,9 +10,9 @@ describe Chef::Provider::Mount::Linux do let(:new_resource) do new_resource = Chef::Resource::Mount.new("/tmp/foo") - new_resource.device "/dev/sdz1" + new_resource.device "/dev/sdz1" new_resource.device_type :device - new_resource.fstype "ext3" + new_resource.fstype "ext3" new_resource.supports remount: false new_resource end @@ -32,6 +32,7 @@ describe Chef::Provider::Mount::Linux do context "to see if the volume is mounted" do it "should set mounted true if the mount point is found in the mounts list" do + allow(provider).to receive(:shell_out!).with("losetup --list").and_return(double(stdout: "/tmp/foo")) allow(provider).to receive(:shell_out!).and_return(double(stdout: "/tmp/foo /dev/sdz1 type ext3 (rw)\n")) provider.load_current_resource expect(provider.current_resource.mounted).to be_truthy @@ -104,4 +105,16 @@ describe Chef::Provider::Mount::Linux do end end -end + context "to check if loop resource is mounted" do + it "should set mounted true in case of loop resource" do + new_resource.options "loop" + mount = "/tmp/foo /dev/loop16 iso660 cifs ro\n" + losetup = "/dev/loop16 0 0 1 1 /dev/sdz1 \n" + allow(provider).to receive(:shell_out!).with("findmnt -rn").and_return(double(stdout: mount)) + allow(provider).to receive(:shell_out!).with("losetup -a").and_return(double(stdout: losetup)) + provider.load_current_resource + expect(provider.current_resource.mounted).to be_truthy + end + end + +end \ No newline at end of file -- cgit v1.2.1 From 1b0bfdda809780f1746f1822d96338028492b66f Mon Sep 17 00:00:00 2001 From: smriti Date: Tue, 30 Nov 2021 17:06:10 +0530 Subject: Rescued error in case losetup command does not exist Signed-off-by: smriti --- lib/chef/provider/mount/linux.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb index 43852e330b..83fbfab957 100644 --- a/lib/chef/provider/mount/linux.rb +++ b/lib/chef/provider/mount/linux.rb @@ -32,6 +32,9 @@ class Chef def loop_mount_points # get loop_mount_points only if not initialized earlier @loop_mount_points ||= shell_out!("losetup -a").stdout + + rescue Errno::ENOENT + @loop_mount_points = "" end def mounted? -- cgit v1.2.1 From 7abda1bca8494ea60a95acbfbaeb1a26cb2df059 Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 20:20:27 +0000 Subject: Bump version to 17.8.19 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba18873b4a..ff99d2ac89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.18](https://github.com/chef/chef/tree/v17.8.18) (2021-11-30) + +## [v17.8.19](https://github.com/chef/chef/tree/v17.8.19) (2021-11-30) #### Merged Pull Requests -- Add allow_downgrade back to DNF [#12291](https://github.com/chef/chef/pull/12291) ([lamont-granquist](https://github.com/lamont-granquist)) +- Smriti/10918 mount resource not idempotent [#11579](https://github.com/chef/chef/pull/11579) ([msys-sgarg](https://github.com/msys-sgarg)) ### Changes not yet released to stable #### Merged Pull Requests +- Smriti/10918 mount resource not idempotent [#11579](https://github.com/chef/chef/pull/11579) ([msys-sgarg](https://github.com/msys-sgarg)) - Add allow_downgrade back to DNF [#12291](https://github.com/chef/chef/pull/12291) ([lamont-granquist](https://github.com/lamont-granquist)) - Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) - Bump omnibus-software from `461fc3e` to `8560231` in /omnibus [#12321](https://github.com/chef/chef/pull/12321) ([dependabot[bot]](https://github.com/dependabot[bot])) diff --git a/Gemfile.lock b/Gemfile.lock index 94f9f51948..a2110f9eb2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.18) + chef (17.8.19) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.18) - chef-utils (= 17.8.18) + chef-config (= 17.8.19) + chef-utils (= 17.8.19) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.18-universal-mingw32) + chef (17.8.19-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.18) - chef-utils (= 17.8.18) + chef-config (= 17.8.19) + chef-utils (= 17.8.19) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.18) - chef (= 17.8.18) + chef-bin (17.8.19) + chef (= 17.8.19) PATH remote: chef-config specs: - chef-config (17.8.18) + chef-config (17.8.19) addressable - chef-utils (= 17.8.18) + chef-utils (= 17.8.19) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.18) + chef-utils (17.8.19) concurrent-ruby GEM diff --git a/VERSION b/VERSION index 48b48bb773..bbb0016b73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.18 \ No newline at end of file +17.8.19 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index f080bbecd2..eed22f2be8 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.18".freeze + VERSION = "17.8.19".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 566a591659..bb0cc60078 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.18".freeze + VERSION = "17.8.19".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 13b2991803..2a2134bdc4 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.18" + VERSION = "17.8.19" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index fea71851fd..c7adbf473f 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.18".freeze + VERSION = "17.8.19".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index b6653df3b2..f828fdf1fa 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.18") + VERSION = Chef::VersionString.new("17.8.19") end # -- cgit v1.2.1 From 8b267e2117bc8c4bad9667274a2665210a25adcd Mon Sep 17 00:00:00 2001 From: Chef Expeditor Date: Tue, 30 Nov 2021 20:26:21 +0000 Subject: Bump version to 17.8.20 by Chef Expeditor Obvious fix; these changes are the result of automation not creative thinking. --- CHANGELOG.md | 7 ++++--- Gemfile.lock | 22 +++++++++++----------- VERSION | 2 +- chef-bin/lib/chef-bin/version.rb | 2 +- chef-config/lib/chef-config/version.rb | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- knife/lib/chef/knife/version.rb | 2 +- lib/chef/version.rb | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff99d2ac89..a8a8a8abe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,18 @@ This changelog lists individual merged pull requests to Chef Infra Client and geared towards developers. For a list of significant changes per release see the [Chef Infra Client Release Notes](https://docs.chef.io/release_notes_client/). - -## [v17.8.19](https://github.com/chef/chef/tree/v17.8.19) (2021-11-30) + +## [v17.8.20](https://github.com/chef/chef/tree/v17.8.20) (2021-11-30) #### Merged Pull Requests -- Smriti/10918 mount resource not idempotent [#11579](https://github.com/chef/chef/pull/11579) ([msys-sgarg](https://github.com/msys-sgarg)) +- use powershell exec in powershell resource [#12278](https://github.com/chef/chef/pull/12278) ([rishichawda](https://github.com/rishichawda)) ### Changes not yet released to stable #### Merged Pull Requests +- use powershell exec in powershell resource [#12278](https://github.com/chef/chef/pull/12278) ([rishichawda](https://github.com/rishichawda)) - Smriti/10918 mount resource not idempotent [#11579](https://github.com/chef/chef/pull/11579) ([msys-sgarg](https://github.com/msys-sgarg)) - Add allow_downgrade back to DNF [#12291](https://github.com/chef/chef/pull/12291) ([lamont-granquist](https://github.com/lamont-granquist)) - Ruby 3.0.3 [#12323](https://github.com/chef/chef/pull/12323) ([lamont-granquist](https://github.com/lamont-granquist)) diff --git a/Gemfile.lock b/Gemfile.lock index a2110f9eb2..9d56810524 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GIT PATH remote: . specs: - chef (17.8.19) + chef (17.8.20) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.19) - chef-utils (= 17.8.19) + chef-config (= 17.8.20) + chef-utils (= 17.8.20) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -66,12 +66,12 @@ PATH train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - chef (17.8.19-universal-mingw32) + chef (17.8.20-universal-mingw32) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.8.19) - chef-utils (= 17.8.19) + chef-config (= 17.8.20) + chef-utils (= 17.8.20) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) @@ -112,15 +112,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (17.8.19) - chef (= 17.8.19) + chef-bin (17.8.20) + chef (= 17.8.20) PATH remote: chef-config specs: - chef-config (17.8.19) + chef-config (17.8.20) addressable - chef-utils (= 17.8.19) + chef-utils (= 17.8.20) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -129,7 +129,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (17.8.19) + chef-utils (17.8.20) concurrent-ruby GEM diff --git a/VERSION b/VERSION index bbb0016b73..d515d3c52b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.8.19 \ No newline at end of file +17.8.20 \ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index eed22f2be8..56fb919641 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.19".freeze + VERSION = "17.8.20".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index bb0cc60078..8c631f8e07 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.19".freeze + VERSION = "17.8.20".freeze end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index 2a2134bdc4..9fb3b1525d 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -16,5 +16,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("..", __dir__) - VERSION = "17.8.19" + VERSION = "17.8.20" end diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb index c7adbf473f..c406e7436e 100644 --- a/knife/lib/chef/knife/version.rb +++ b/knife/lib/chef/knife/version.rb @@ -17,7 +17,7 @@ class Chef class Knife KNIFE_ROOT = File.expand_path("../..", __dir__) - VERSION = "17.8.19".freeze + VERSION = "17.8.20".freeze end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index f828fdf1fa..ef237e0df9 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("..", __dir__) - VERSION = Chef::VersionString.new("17.8.19") + VERSION = Chef::VersionString.new("17.8.20") end # -- cgit v1.2.1