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 /lib | |
parent | d8f1eaaf32ea181a60e537243ca12e9c4d34ee62 (diff) | |
parent | bfd6d37806ddea18eb0c7c402ff68b42cd43467d (diff) | |
download | chef-62a0d5754d13579700e007bfcc84d560871d2c4d.tar.gz |
Merge pull request #12688 from chef/march_16_2022_release
Diffstat (limited to 'lib')
-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 |
6 files changed, 15 insertions, 16 deletions
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 |