diff options
author | Lamont Granquist <454857+lamont-granquist@users.noreply.github.com> | 2022-03-17 14:36:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 14:36:34 -0700 |
commit | 62a0d5754d13579700e007bfcc84d560871d2c4d (patch) | |
tree | c6a6da5714d3a66e3a816422ec3a237820f583c6 | |
parent | d8f1eaaf32ea181a60e537243ca12e9c4d34ee62 (diff) | |
parent | bfd6d37806ddea18eb0c7c402ff68b42cd43467d (diff) | |
download | chef-62a0d5754d13579700e007bfcc84d560871d2c4d.tar.gz |
Merge pull request #12688 from chef/march_16_2022_release
-rw-r--r-- | .github/workflows/func_spec.yml | 2 | ||||
-rw-r--r-- | .github/workflows/kitchen.yml | 17 | ||||
-rw-r--r-- | Gemfile.lock | 66 | ||||
-rw-r--r-- | chef-universal-mingw32.gemspec | 3 | ||||
-rw-r--r-- | kitchen-tests/kitchen.yml | 1 | ||||
-rw-r--r-- | lib/chef/api_client.rb | 2 | ||||
-rw-r--r-- | lib/chef/policy_builder/expand_node_object.rb | 3 | ||||
-rw-r--r-- | lib/chef/policy_builder/policyfile.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/rubygems.rb | 12 | ||||
-rw-r--r-- | lib/chef/provider/service/windows.rb | 8 | ||||
-rw-r--r-- | lib/chef/provider/user/windows.rb | 4 |
11 files changed, 71 insertions, 49 deletions
diff --git a/.github/workflows/func_spec.yml b/.github/workflows/func_spec.yml index 27cee8a7f4..2247b414fd 100644 --- a/.github/workflows/func_spec.yml +++ b/.github/workflows/func_spec.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, windows-2016] + os: [windows-2019, windows-2022] # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' ruby: [2.7, '3.0'] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index 705b6ac1dc..f2c278aa6c 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -44,12 +44,28 @@ jobs: run: | cd kitchen-tests $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + # htmldiff and ldiff on windows cause a conflict with gems being loaded below. + # we remove thenm here. + if (Test-Path C:\opscode\chef\embedded\bin\htmldiff) + { + Remove-Item -Path C:\opscode\chef\embedded\bin\htmldiff + Remove-Item -Path C:\opscode\chef\embedded\bin\ldiff + } + # The chef-client installer does not put the file 'ansidecl.h' down in the correct location + # This leads to failures during testing. Moving that file to its correct position here. + # Another example of 'bad' that needs to be corrected + $output = gci -path C:\opscode\ -file ansidecl.h -Recurse + $target_path = $($output.Directory.Parent.FullName + "\x86_64-w64-mingw32\include") + Move-Item -Path $output.FullName -Destination $target_path + bundle install --jobs=3 --retry=3 # If ($lastexitcode -ne 0) { Exit $lastexitcode } # The bundle install command above fails because our build on windows on ruby-3.0 is # completely broken when it comes to installing native gems. Until that is fixed we # need to ignore that error code and to manually install berkshelf below. This is a # very bad hack. + + If ($lastexitcode -ne 0) { Exit $lastexitcode } gem install berkshelf --no-doc If ($lastexitcode -ne 0) { Exit $lastexitcode } berks vendor cookbooks @@ -89,6 +105,7 @@ jobs: sudo /opt/chef/embedded/bin/bundle config set --local without 'omnibus_package' sudo /opt/chef/embedded/bin/bundle config set --local path 'vendor/bundle' sudo /opt/chef/embedded/bin/bundle install --jobs=3 --retry=3 + sudo rm -f /opt/chef/embedded/bin/{htmldiff,ldiff} sudo /opt/chef/embedded/bin/gem install berkshelf --no-doc sudo /opt/chef/embedded/bin/berks vendor cookbooks sudo /opt/chef/bin/chef-client -z -o end_to_end --chef-license accept-no-persist diff --git a/Gemfile.lock b/Gemfile.lock index 1844ff89ab..2aaba72fdb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/chef/chefstyle.git - revision: de278c0906b397de4b67bbb6d1cf19ab29f9c190 + revision: 71ae97744713ffd91ac8277d7a1385dabb6d570b branch: main specs: - chefstyle (2.2.0) - rubocop (= 1.24.1) + chefstyle (2.2.2) + rubocop (= 1.25.1) GIT remote: https://github.com/chef/ohai.git @@ -71,6 +71,7 @@ PATH aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) chef-config (= 17.9.61) + chef-powershell (~> 1.0.12) chef-utils (= 17.9.61) chef-vault chef-zero (>= 14.0.11) @@ -142,7 +143,7 @@ GEM mixlib-shellout (>= 2.0, < 4.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.567.0) + aws-partitions (1.568.0) aws-sdk-core (3.130.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -164,6 +165,9 @@ GEM debug_inspector (>= 0.0.1) builder (3.2.4) byebug (11.1.3) + chef-powershell (1.0.13) + ffi (~> 1.15) + ffi-yajl (~> 2.4) chef-telemetry (1.1.1) chef-config concurrent-ruby (~> 1.0) @@ -205,11 +209,11 @@ GEM faraday-net_http_persistent (1.2.0) faraday_middleware (1.2.0) faraday (~> 1.0) - fauxhai-ng (9.1.0) + fauxhai-ng (9.3.0) net-ssh - ffi (1.15.4) - ffi (1.15.4-x64-mingw32) - ffi (1.15.4-x86-mingw32) + ffi (1.15.5) + ffi (1.15.5-x64-mingw32) + ffi (1.15.5-x86-mingw32) ffi-libarchive (1.1.3) ffi (~> 1.0) ffi-win32-extensions (1.0.4) @@ -225,7 +229,7 @@ GEM hashie (4.1.0) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.52.9) + inspec-core (4.56.17) addressable (~> 2.4) chef-telemetry (~> 1.0, >= 1.0.8) faraday (>= 0.9.0, < 1.5) @@ -238,7 +242,7 @@ GEM parallel (~> 1.9) parslet (>= 1.5, < 2.0) pry (~> 0.13) - rspec (>= 3.9, < 3.11) + rspec (>= 3.9, <= 3.11) rspec-its (~> 1.2) rubyzip (>= 1.2.2, < 3.0) semverse (~> 3.0) @@ -248,8 +252,8 @@ GEM train-core (~> 3.0) tty-prompt (~> 0.17) tty-table (~> 0.10) - inspec-core-bin (4.52.9) - inspec-core (= 4.52.9) + inspec-core-bin (4.56.17) + inspec-core (= 4.56.17) ipaddress (0.8.3) iso8601 (0.13.0) jmespath (1.6.1) @@ -290,7 +294,7 @@ GEM net-ssh (6.1.0) nori (2.6.0) parallel (1.21.0) - parser (3.1.0.0) + parser (3.1.1.0) ast (~> 2.4.1) parslet (1.8.2) pastel (0.8.0) @@ -308,38 +312,38 @@ GEM pry (~> 0.13) public_suffix (4.0.6) rack (2.2.3) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) rb-readline (0.5.5) - regexp_parser (2.2.0) + regexp_parser (2.2.1) rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) + rspec-support (~> 3.11.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.10.2) + rspec-mocks (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.3) - rubocop (1.24.1) + rspec-support (~> 3.11.0) + rspec-support (3.11.0) + rubocop (1.25.1) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.1) - parser (>= 3.0.1.1) + rubocop-ast (1.16.0) + parser (>= 3.1.1.0) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) rubyntlm (0.6.3) @@ -355,7 +359,7 @@ GEM syslog-logger (1.6.8) thor (1.2.1) tomlrb (1.3.0) - train-core (3.8.6) + train-core (3.8.9) addressable (~> 2.5) ffi (!= 1.13.0) json (>= 1.8, < 3.0) diff --git a/chef-universal-mingw32.gemspec b/chef-universal-mingw32.gemspec index 329b4f9d6b..6d9497486c 100644 --- a/chef-universal-mingw32.gemspec +++ b/chef-universal-mingw32.gemspec @@ -14,7 +14,8 @@ gemspec.add_dependency "win32-service", ">= 2.1.5", "< 3.0" gemspec.add_dependency "wmi-lite", "~> 1.0" gemspec.add_dependency "win32-taskscheduler", "~> 2.0" gemspec.add_dependency "iso8601", ">= 0.12.1", "< 0.14" # validate 0.14 when it comes out -gemspec.add_dependency "win32-certstore", "~> 0.6.2" # 0.5+ required for specifying user vs. system store +gemspec.add_dependency "win32-certstore", "~> 0.6.2" +gemspec.add_dependency "chef-powershell", "~> 1.0.12" # 0.5+ required for specifying user vs. system store gemspec.extensions << "ext/win32-eventlog/Rakefile" gemspec.files += Dir.glob("{distro,ext}/**/*") diff --git a/kitchen-tests/kitchen.yml b/kitchen-tests/kitchen.yml index 55a3640fb8..132594588d 100644 --- a/kitchen-tests/kitchen.yml +++ b/kitchen-tests/kitchen.yml @@ -15,6 +15,7 @@ provisioner: always_dump_stacktrace: true chef_license: "accept-no-persist" slow_resource_report: true + clean_dokken_sandbox: false lifecycle: pre_converge: diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb index 75eee6883c..8a97f532fd 100644 --- a/lib/chef/api_client.rb +++ b/lib/chef/api_client.rb @@ -196,7 +196,7 @@ class Chef end def reregister - reregistered_self = http_api.put("clients/#{name}", { name: name, admin: admin, validator: validator, private_key: true }) + reregistered_self = http_api.put("clients/#{name}", name: name, admin: admin, validator: validator, private_key: true ) if reregistered_self.respond_to?(:[]) private_key(reregistered_self["private_key"]) else diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb index 965e4defe6..1890480137 100644 --- a/lib/chef/policy_builder/expand_node_object.rb +++ b/lib/chef/policy_builder/expand_node_object.rb @@ -248,8 +248,7 @@ class Chef end def api_service - @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], - { version_class: Chef::CookbookManifestVersions }) + @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], version_class: Chef::CookbookManifestVersions ) end def config diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 0603acf958..94fd56f0b7 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -507,7 +507,7 @@ class Chef # @api private def api_service @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], - { version_class: Chef::CookbookManifestVersions }) + version_class: Chef::CookbookManifestVersions) end # @api private diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb index 1a396a364b..bb76eacc56 100644 --- a/lib/chef/provider/package/rubygems.rb +++ b/lib/chef/provider/package/rubygems.rb @@ -214,7 +214,7 @@ class Chef def install(gem_dependency, options = {}) with_gem_sources(*options.delete(:sources)) do with_correct_verbosity do - dependency_installer(options).install(gem_dependency) + dependency_installer(**options).install(gem_dependency) end end end @@ -228,7 +228,7 @@ class Chef def uninstall(gem_name, gem_version = nil, opts = {}) gem_version ? opts[:version] = gem_version : opts[:all] = true with_correct_verbosity do - uninstaller(gem_name, opts).uninstall + uninstaller(gem_name, **opts).uninstall end end @@ -240,12 +240,12 @@ class Chef yield end - def dependency_installer(opts = {}) - Gem::DependencyInstaller.new(opts) + def dependency_installer(**opts) + Gem::DependencyInstaller.new(**opts) end - def uninstaller(gem_name, opts = {}) - Gem::Uninstaller.new(gem_name, DEFAULT_UNINSTALLER_OPTS.merge(opts)) + def uninstaller(gem_name, **opts) + Gem::Uninstaller.new(gem_name, **DEFAULT_UNINSTALLER_OPTS.merge(opts)) end private diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index ba2ecf224c..09b378e557 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -183,7 +183,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service end converge_by("create service #{new_resource.service_name}") do - Win32::Service.new(windows_service_config) + Win32::Service.new(**windows_service_config) end converge_delayed_start @@ -209,7 +209,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service converge_if_changed :service_type, :startup_type, :error_control, :binary_path_name, :load_order_group, :dependencies, :run_as_user, :display_name, :description do - Win32::Service.configure(windows_service_config(:configure)) + Win32::Service.configure(**windows_service_config(:configure)) end converge_delayed_start @@ -268,7 +268,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service password: new_resource.run_as_password, }.reject { |k, v| v.nil? || v.length == 0 } - Win32::Service.configure(new_config) + Win32::Service.configure(**new_config) logger.info "#{new_resource} configured." grant_service_logon(new_resource.run_as_user) if new_resource.run_as_user != "localsystem" @@ -395,7 +395,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service config[:service_name] = new_resource.service_name config[:delayed_start] = new_resource.delayed_start ? 1 : 0 - Win32::Service.configure(config) + Win32::Service.configure(**config) end end diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 8cf4ea475b..f7ab96b0e9 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -78,11 +78,11 @@ class Chef end def create_user - @net_user.add(set_options) + @net_user.add(**set_options) end def manage_user - @net_user.update(set_options) + @net_user.update(**set_options) end def remove_user |