summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <jmccrae@chef.io>2021-05-11 11:39:14 -0700
committerGitHub <noreply@github.com>2021-05-11 11:39:14 -0700
commitdf995ae0cf5dd3013455de436f5ac84e41bc2271 (patch)
treedffa1b5fabcc995030f8ba2487864f33fb3309e8
parentb12eac9a966b81bf3c87fd2343cdd7c47de94ec8 (diff)
parent2a955d0a1c91e11d40a8ef9eabf49ee96bcd685e (diff)
downloadchef-df995ae0cf5dd3013455de436f5ac84e41bc2271.tar.gz
Merge branch 'master' into jfm/win_hostname
-rw-r--r--CHANGELOG.md12
-rw-r--r--Gemfile.lock32
-rw-r--r--RELEASE_NOTES.md76
-rw-r--r--Rakefile4
-rw-r--r--VERSION2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/lib/chef-config/config.rb4
-rw-r--r--chef-config/lib/chef-config/path_helper.rb2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--chef-config/spec/unit/path_helper_spec.rb4
-rw-r--r--chef-utils/lib/chef-utils/internal.rb2
-rw-r--r--chef-utils/lib/chef-utils/version.rb2
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb4
-rw-r--r--knife/lib/chef/knife/version.rb2
-rw-r--r--knife/spec/support/chef_helpers.rb2
-rw-r--r--knife/spec/unit/application/knife_spec.rb2
-rw-r--r--lib/chef/chef_fs/file_pattern.rb4
-rw-r--r--lib/chef/provider/link.rb2
-rw-r--r--lib/chef/provider/registry_key.rb2
-rw-r--r--lib/chef/provider/windows_script.rb2
-rw-r--r--lib/chef/resource/execute.rb4
-rw-r--r--lib/chef/resource/hostname.rb26
-rw-r--r--lib/chef/resource/remote_file.rb4
-rw-r--r--lib/chef/resource/windows_env.rb2
-rw-r--r--lib/chef/resource/windows_font.rb2
-rw-r--r--lib/chef/resource/windows_pagefile.rb4
-rw-r--r--lib/chef/resource/windows_path.rb4
-rw-r--r--lib/chef/resource/windows_security_policy.rb4
-rw-r--r--lib/chef/resource/windows_task.rb2
-rw-r--r--lib/chef/run_lock.rb2
-rw-r--r--lib/chef/version.rb2
-rw-r--r--omnibus/config/software/more-ruby-cleanup.rb6
-rw-r--r--spec/functional/resource/group_spec.rb2
-rw-r--r--spec/functional/resource/link_spec.rb2
-rw-r--r--spec/functional/resource/remote_file_spec.rb2
-rw-r--r--spec/functional/resource/windows_env_spec.rb4
-rw-r--r--spec/support/chef_helpers.rb2
-rw-r--r--spec/support/shared/functional/execute_resource.rb2
-rw-r--r--spec/support/shared/unit/provider/file.rb2
-rw-r--r--spec/unit/provider/link_spec.rb2
40 files changed, 146 insertions, 98 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 309c4e13dc..3816cc2445 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,18 +1,22 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
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/).
-<!-- latest_release 17.1.30 -->
-## [v17.1.30](https://github.com/chef/chef/tree/v17.1.30) (2021-05-08)
+<!-- latest_release 17.1.35 -->
+## [v17.1.35](https://github.com/chef/chef/tree/v17.1.35) (2021-05-11)
#### Merged Pull Requests
-- Creating the `inspec_waiver_file_entry` resource for managing and formatting a waiver file [#10098](https://github.com/chef/chef/pull/10098) ([chef-davin](https://github.com/chef-davin))
-- Remove comment no longer relevant [#11550](https://github.com/chef/chef/pull/11550) ([deivid-rodriguez](https://github.com/deivid-rodriguez))
+- Revert windows hostname changes for now [#11564](https://github.com/chef/chef/pull/11564) ([tas50](https://github.com/tas50))
<!-- latest_release -->
<!-- release_rollup since=17.0.242 -->
### Changes not yet released to stable
#### Merged Pull Requests
+- Revert windows hostname changes for now [#11564](https://github.com/chef/chef/pull/11564) ([tas50](https://github.com/tas50)) <!-- 17.1.35 -->
+- Strip the __env_path variable in the which helper [#11561](https://github.com/chef/chef/pull/11561) ([tas50](https://github.com/tas50)) <!-- 17.1.34 -->
+- Revert &quot;Kept a check in pattern matching for a mount of type loop&quot; [#11557](https://github.com/chef/chef/pull/11557) ([tas50](https://github.com/tas50)) <!-- 17.1.33 -->
+- mount: Fix idempotentency for loopback mounts [#11376](https://github.com/chef/chef/pull/11376) ([msys-sgarg](https://github.com/msys-sgarg)) <!-- 17.1.32 -->
+- Bump chef/chefstyle to 9e9864d3839e1a78703e6662b0dbe7a04af05fd1 [#11527](https://github.com/chef/chef/pull/11527) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) <!-- 17.1.31 -->
- Creating the `inspec_waiver_file_entry` resource for managing and formatting a waiver file [#10098](https://github.com/chef/chef/pull/10098) ([chef-davin](https://github.com/chef-davin)) <!-- 17.1.30 -->
- Remove comment no longer relevant [#11550](https://github.com/chef/chef/pull/11550) ([deivid-rodriguez](https://github.com/deivid-rodriguez)) <!-- 17.1.29 -->
- Silence `bundle install` warning when installing gems for cookbooks [#11551](https://github.com/chef/chef/pull/11551) ([nvwls](https://github.com/nvwls)) <!-- 17.1.29 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index edffb1dab0..2e9a70e083 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,10 +1,10 @@
GIT
remote: https://github.com/chef/chefstyle.git
- revision: 6b08692b230b9766b9e730c57aca8a94b0749782
+ revision: aabbd0cd0b6ad646e55370277ee5af4eefed148a
branch: master
specs:
- chefstyle (2.0.1)
- rubocop (= 1.13.0)
+ chefstyle (2.0.3)
+ rubocop (= 1.14.0)
GIT
remote: https://github.com/chef/ohai.git
@@ -35,10 +35,10 @@ GIT
PATH
remote: .
specs:
- chef (17.1.30)
+ chef (17.1.35)
addressable
- chef-config (= 17.1.30)
- chef-utils (= 17.1.30)
+ chef-config (= 17.1.35)
+ chef-utils (= 17.1.35)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -62,10 +62,10 @@ PATH
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
uuidtools (>= 2.1.5, < 3.0)
- chef (17.1.30-universal-mingw32)
+ chef (17.1.35-universal-mingw32)
addressable
- chef-config (= 17.1.30)
- chef-utils (= 17.1.30)
+ chef-config (= 17.1.35)
+ chef-utils (= 17.1.35)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -104,15 +104,15 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (17.1.30)
- chef (= 17.1.30)
+ chef-bin (17.1.35)
+ chef (= 17.1.35)
PATH
remote: chef-config
specs:
- chef-config (17.1.30)
+ chef-config (17.1.35)
addressable
- chef-utils (= 17.1.30)
+ chef-utils (= 17.1.35)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
@@ -121,7 +121,7 @@ PATH
PATH
remote: chef-utils
specs:
- chef-utils (17.1.30)
+ chef-utils (17.1.35)
concurrent-ruby
GEM
@@ -290,13 +290,13 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
- rubocop (1.13.0)
+ rubocop (1.14.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
- rubocop-ast (>= 1.2.0, < 2.0)
+ rubocop-ast (>= 1.5.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.5.0)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 98b2160e3a..2308d12acf 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,11 +1,77 @@
This file holds "in progress" release notes for the current release under development and is intended for consumption by the Chef Documentation team. Please see <https://docs.chef.io/release_notes/> for the official Chef release notes.
-## 17.1 WIP
+## What's New in 17.1
-- CLI reporter default in Compliance Phase: https://github.com/chef/chef/pull/11481
-- Fix windows failures: https://github.com/chef/chef/pull/11472
-- Bump InSpec to 4.36: https://github.com/chef/chef/pull/11474
-- Yum improvements: https://github.com/chef/chef/pull/11486
+### Compliance Phase Improvements
+
+#### cli reporter by default
+
+The compliance phase will now default to using both the `json-file` and the new `cli` reporter by default. This gives you a visual indication of the success of the Compliance Phase and is perfect for running both on the CLI and in Test Kitchen.
+
+#### inspec_waiver_file_entry resource
+
+Chef Infra Client now ships with a `inspec_waiver_file_entry` resource for managing Chef InSpec waivers. With this resource you can add and remove waiver entries to a single waiver file located at `c:\chef\inspec_waiver_file.yml` on Windows or `/etc/chef/inspec_waivers.yml` on all other systems.
+
+See the [inspec_waiver_file_entry documentation](https://docs.chef.io/resources/inspec_waiver_file_entry) for more information and usage examples.
+
+#### Chef InSpec 4.36
+
+We've updated Chef InSpec from 4.33.1 to 4.36.4:
+
+- Added the selinux resource which includes support for modules and booleans.
+- Added the pattern input option for DSL and metadata inputs.
+- Added the `members_array` property for group & groups resources.
+- Train now reads the username and port from the `.ssh/config` file and will use these values if present.
+- Switch to GNU timeout-based implementation of SSH timeouts.
+- Fixed the group resource when a member does not exist.
+
+### Unified Mode Improvements
+
+We've extended support for Unified Mode to the `edit_resource` helper and also improved the Unified Mode related deprecation warnings to provide more useful information and not warn when resources are deprecated or set to only run on older Chef Infra Client releases.
+
+### Resource Improvements
+
+#### hostname
+
+The `hostname` resource now supports changing the hostname on Active Directory connected Windows hosts when using new `domain_user` and `domain_password` properties.
+
+#### service on systemd Hosts
+
+The `service` resource on systemd hosts will now properly load the state of the service. Thanks for this fix [@ramereth](https://github.com/ramereth)!
+
+#### systemd_unit
+
+We updated the `systemd_unit` resource to resolve a regression in Chef Infra Client 17.0 that would re-enable and restart unit files on each Chef Infra Client run. Thanks for this fix [@gene1wood](https://github.com/gene1wood)!
+
+#### template
+
+We updated the `template` resource to allow passing the `cookbook_name` variable to template files.
+
+#### Windows Resource
+
+We fixed a failure that could occur in multiple Windows resources due to larger 64-bit values that logged the error: `RangeError: bignum too big to convert into 'long'`.
+
+#### windows_security_policy
+
+The `windows_security_policy` resource now supports setting `AuditPolicyChange` and `LockoutDuration`.
+
+#### yum_package / dnf_package
+
+We've made multiple improvements to how we interact with the systems RPM database in the `yum_package` and `dnf_package` resources. These changes improve reliability interacting with the RPM database and includes significant performance improvements, especially when no installation or upgrade action is taken by Chef Infra Client.
+
+### Platform Detection
+
+[Rocky Linux](https://rockylinux.org/), a RHEL clone, is now detected as a member of the `rhel` platform family.
+
+### Packaging
+
+### Improved Dependencies
+
+Chef Infra Client 17.1 is once again smaller than previous releases thanks to reduced dependencies in the packages.
+
+### RHEL 8 Packages
+
+We imporved our RHEL 8 packages with additional RHEL 8 optimizations and EL8 in the filename.
## What's New in 17.0
diff --git a/Rakefile b/Rakefile
index d3a8aebf44..b0dfb63b26 100644
--- a/Rakefile
+++ b/Rakefile
@@ -108,8 +108,8 @@ task :update_chef_exec_dll do
sh("hab pkg install chef/chef-powershell-shim")
sh("hab pkg install chef/chef-powershell-shim-x86")
- x64 = `hab pkg path chef/chef-powershell-shim`.chomp.tr('\\', "/")
- x86 = `hab pkg path chef/chef-powershell-shim-x86`.chomp.tr('\\', "/")
+ x64 = `hab pkg path chef/chef-powershell-shim`.chomp.tr("\\", "/")
+ x86 = `hab pkg path chef/chef-powershell-shim-x86`.chomp.tr("\\", "/")
FileUtils.rm_rf(Dir["distro/ruby_bin_folder/AMD64/*"])
FileUtils.rm_rf(Dir["distro/ruby_bin_folder/x86/*"])
puts "Copying #{x64}/bin/* to distro/ruby_bin_folder/AMD64"
diff --git a/VERSION b/VERSION
index 56305fe362..7b9ba652f7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.1.30 \ No newline at end of file
+17.1.35 \ 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 20abb3db35..00e1ccad29 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.1.30".freeze
+ VERSION = "17.1.35".freeze
end
#
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index 2f261b45a7..2496a07eae 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -71,8 +71,8 @@ module ChefConfig
# Some installations will be on different drives so use the drive that
# the expanded path to __FILE__ is found.
drive = windows_installation_drive
- if drive && path[0] == '\\' && path.split('\\')[2] == "chef"
- path = PathHelper.join(drive, path.split('\\', 3)[2])
+ if drive && path[0] == "\\" && path.split("\\")[2] == "chef"
+ path = PathHelper.join(drive, path.split("\\", 3)[2])
end
end
path
diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb
index 8fe45febfc..adacade391 100644
--- a/chef-config/lib/chef-config/path_helper.rb
+++ b/chef-config/lib/chef-config/path_helper.rb
@@ -45,7 +45,7 @@ module ChefConfig
end
end
- BACKSLASH = '\\'.freeze
+ BACKSLASH = "\\".freeze
def self.path_separator(windows: ChefUtils.windows?)
if windows
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index a573d24dc8..4f967e56c0 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.1.30".freeze
+ VERSION = "17.1.35".freeze
end
diff --git a/chef-config/spec/unit/path_helper_spec.rb b/chef-config/spec/unit/path_helper_spec.rb
index 5721e105ec..de45de2a62 100644
--- a/chef-config/spec/unit/path_helper_spec.rb
+++ b/chef-config/spec/unit/path_helper_spec.rb
@@ -56,7 +56,7 @@ RSpec.describe ChefConfig::PathHelper do
context "forcing windows/non-windows" do
context "forcing windows" do
it "path_separator is \\" do
- expect(path_helper.path_separator(windows: true)).to eq('\\')
+ expect(path_helper.path_separator(windows: true)).to eq("\\")
end
context "platform-specific #join behavior" do
@@ -133,7 +133,7 @@ RSpec.describe ChefConfig::PathHelper do
end
it "path_separator is \\" do
- expect(path_helper.path_separator).to eq('\\')
+ expect(path_helper.path_separator).to eq("\\")
end
context "platform-specific #join behavior" do
diff --git a/chef-utils/lib/chef-utils/internal.rb b/chef-utils/lib/chef-utils/internal.rb
index e5a7e65c89..0699618a5a 100644
--- a/chef-utils/lib/chef-utils/internal.rb
+++ b/chef-utils/lib/chef-utils/internal.rb
@@ -70,7 +70,7 @@ module ChefUtils
#
def __env_path
if __transport_connection
- __transport_connection.run_command("echo $PATH").stdout || ""
+ __transport_connection.run_command("echo $PATH").stdout.chomp || ""
else
ENV["PATH"] || ""
end
diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb
index 0c3cd8104e..ce3cf1687e 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.1.30"
+ VERSION = "17.1.35"
end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 0f8a7446d0..b1a0dac28f 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -5,6 +5,10 @@
# Copyright:: Copyright (c) Chef Software Inc.
#
+# hostnames on windows cannot contain a '.'
+# hostname on windows requires a reboot
+# hostname "chef-bk-ci"
+
chef_sleep "2"
execute "dir"
diff --git a/knife/lib/chef/knife/version.rb b/knife/lib/chef/knife/version.rb
index 5ccf1e9358..fc339fd630 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.1.30".freeze
+ VERSION = "17.1.35".freeze
end
end
diff --git a/knife/spec/support/chef_helpers.rb b/knife/spec/support/chef_helpers.rb
index 3738c4a41e..f11dee47b6 100644
--- a/knife/spec/support/chef_helpers.rb
+++ b/knife/spec/support/chef_helpers.rb
@@ -43,7 +43,7 @@ end
# This is a helper to canonicalize paths that we're using in the file
# tests.
def canonicalize_path(path)
- windows? ? path.tr("/", '\\') : path
+ windows? ? path.tr("/", "\\") : path
end
# Makes a temp directory with a canonical path on any platform.
diff --git a/knife/spec/unit/application/knife_spec.rb b/knife/spec/unit/application/knife_spec.rb
index ad705ab1e5..300f2b2f83 100644
--- a/knife/spec/unit/application/knife_spec.rb
+++ b/knife/spec/unit/application/knife_spec.rb
@@ -163,7 +163,7 @@ describe Chef::Application::Knife do
expect(@knife).to receive(:exit).with(0)
@knife.run
end
- expect(Chef::Config[:client_key]).to eq(File.join(ENV["HOME"], ".chef/client.pem").gsub((File::ALT_SEPARATOR || '\\'), File::SEPARATOR))
+ expect(Chef::Config[:client_key]).to eq(File.join(ENV["HOME"], ".chef/client.pem").gsub((File::ALT_SEPARATOR || "\\"), File::SEPARATOR))
end
it "does not expand a full path" do
diff --git a/lib/chef/chef_fs/file_pattern.rb b/lib/chef/chef_fs/file_pattern.rb
index 37e72f379b..7e7a58e312 100644
--- a/lib/chef/chef_fs/file_pattern.rb
+++ b/lib/chef/chef_fs/file_pattern.rb
@@ -255,7 +255,7 @@ class Chef
end
def self.regexp_escape_characters
- [ "[", '\\', "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}" ]
+ [ "[", "\\", "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}" ]
end
def self.pattern_to_regexp(pattern)
@@ -281,7 +281,7 @@ class Chef
exact = nil
regexp << "."
else
- if part[0, 1] == '\\' && part.length == 2
+ if part[0, 1] == "\\" && part.length == 2
# backslash escapes are only supported on Unix, and are handled here by leaving the escape on (it means the same thing in a regex)
exact << part[1, 1] unless exact.nil?
if regexp_escape_characters.include?(part[1, 1])
diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb
index 3c81ea1414..113807e49a 100644
--- a/lib/chef/provider/link.rb
+++ b/lib/chef/provider/link.rb
@@ -73,7 +73,7 @@ class Chef
end
def canonicalize(path)
- ChefUtils.windows? ? path.tr("/", '\\') : path
+ ChefUtils.windows? ? path.tr("/", "\\") : path
end
action :create do
diff --git a/lib/chef/provider/registry_key.rb b/lib/chef/provider/registry_key.rb
index 316a2a1081..5d723feb29 100644
--- a/lib/chef/provider/registry_key.rb
+++ b/lib/chef/provider/registry_key.rb
@@ -78,7 +78,7 @@ class Chef
def define_resource_requirements
requirements.assert(:create, :create_if_missing, :delete, :delete_key) do |a|
a.assertion { registry.hive_exists?(new_resource.key) }
- a.failure_message(Chef::Exceptions::Win32RegHiveMissing, "Hive #{new_resource.key.split('\\').shift} does not exist")
+ a.failure_message(Chef::Exceptions::Win32RegHiveMissing, "Hive #{new_resource.key.split("\\").shift} does not exist")
end
requirements.assert(:create) do |a|
diff --git a/lib/chef/provider/windows_script.rb b/lib/chef/provider/windows_script.rb
index a93319a35a..ee986c6d59 100644
--- a/lib/chef/provider/windows_script.rb
+++ b/lib/chef/provider/windows_script.rb
@@ -83,7 +83,7 @@ class Chef
username = new_resource.user
if new_resource.domain
- username = new_resource.domain + '\\' + new_resource.user
+ username = new_resource.domain + "\\" + new_resource.user
end
# Create an ACE that allows the alternate user read access to the script
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 88f52bbde1..b830f119be 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -633,13 +633,13 @@ class Chef
end
# if domain is provided in both username and domain
- if specified_user.is_a?(String) && ((specified_user.include? '\\') || (specified_user.include? "@")) && specified_domain
+ if specified_user.is_a?(String) && ((specified_user.include? "\\") || (specified_user.include? "@")) && specified_domain
raise ArgumentError, "The domain is provided twice. Username: `#{specified_user}`, Domain: `#{specified_domain}`. Please specify domain only once."
end
if specified_user.is_a?(String) && specified_domain.nil?
# Splitting username of format: Domain\Username
- domain_and_user = user.split('\\')
+ domain_and_user = user.split("\\")
if domain_and_user.length == 2
domain = domain_and_user[0]
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 1c3781fccd..b313f8e1c8 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -44,24 +44,6 @@ class Chef
ipaddress '198.51.100.2'
end
```
-
- **Change the hostname of a Windows, Non-Domain joined node**:
-
- ```ruby
- hostname 'renaming a workgroup computer' do
- hostname 'Foo'
- end
- ```
-
- **Change the hostname of a Windows, Domain-joined node**:
-
- ```ruby
- hostname 'renaming a domain-joined computer' do
- hostname 'Foo'
- domain_user 'Domain\Someone'
- domain_password 'SomePassword'
- end
- ```
DOC
property :hostname, String,
@@ -89,14 +71,6 @@ class Chef
description: "Determines whether or not Windows should be reboot after changing the hostname, as this is required for the change to take effect.",
default: true
- property :domain_user, String,
- description: "The domain username with permissions to change the local hostname. Specified in the form of 'Domain\User'. (Windows hosts only)",
- introduced: "17.1"
-
- property :domain_password, String,
- description: "The password associated with the domain user account. (Windows hosts only)",
- introduced: "17.1"
-
action_class do
def append_replacing_matching_lines(path, regex, string)
text = IO.read(path).split("\n")
diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb
index f47a8ba2c9..8eca1c3337 100644
--- a/lib/chef/resource/remote_file.rb
+++ b/lib/chef/resource/remote_file.rb
@@ -142,13 +142,13 @@ class Chef
end
# if domain is provided in both username and domain
- if specified_user && ((specified_user.include? '\\') || (specified_user.include? "@")) && specified_domain
+ if specified_user && ((specified_user.include? "\\") || (specified_user.include? "@")) && specified_domain
raise ArgumentError, "The domain is provided twice. Username: `#{specified_user}`, Domain: `#{specified_domain}`. Please specify domain only once."
end
if ! specified_user.nil? && specified_domain.nil?
# Splitting username of format: Domain\Username
- domain_and_user = user.split('\\')
+ domain_and_user = user.split("\\")
if domain_and_user.length == 2
domain = domain_and_user[0]
diff --git a/lib/chef/resource/windows_env.rb b/lib/chef/resource/windows_env.rb
index dde3412ef5..c8385ecc1b 100644
--- a/lib/chef/resource/windows_env.rb
+++ b/lib/chef/resource/windows_env.rb
@@ -186,7 +186,7 @@ class Chef
if environment_variables && environment_variables.length > 0
environment_variables.each do |env|
@env_obj = env.wmi_ole_object
- return @env_obj if @env_obj.username.split('\\').last.casecmp(new_resource.user) == 0
+ return @env_obj if @env_obj.username.split("\\").last.casecmp(new_resource.user) == 0
end
end
@env_obj = nil
diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb
index 6a7d065678..9043ba94f3 100644
--- a/lib/chef/resource/windows_font.rb
+++ b/lib/chef/resource/windows_font.rb
@@ -43,7 +43,7 @@ class Chef
property :source, String,
description: "A local filesystem path or URI that is used to source the font file.",
- coerce: proc { |x| /^.:.*/.match?(x) ? x.tr('\\', "/").gsub("//", "/") : x }
+ coerce: proc { |x| /^.:.*/.match?(x) ? x.tr("\\", "/").gsub("//", "/") : x }
action :install, description: "Install a font to the system fonts directory" do
if font_exists?
diff --git a/lib/chef/resource/windows_pagefile.rb b/lib/chef/resource/windows_pagefile.rb
index 6b39bfc35b..871f36b3c7 100644
--- a/lib/chef/resource/windows_pagefile.rb
+++ b/lib/chef/resource/windows_pagefile.rb
@@ -56,7 +56,7 @@ class Chef
DOC
property :path, String,
- coerce: proc { |x| x.tr("/", '\\') },
+ coerce: proc { |x| x.tr("/", "\\") },
description: "An optional property to set the pagefile name if it differs from the resource block's name.",
name_property: true
@@ -220,7 +220,7 @@ class Chef
end
def get_setting_id(pagefile)
- split_path = pagefile.split('\\')
+ split_path = pagefile.split("\\")
"#{split_path[1]} @ #{split_path[0]}"
end
diff --git a/lib/chef/resource/windows_path.rb b/lib/chef/resource/windows_path.rb
index f0cc316e66..45077f74af 100644
--- a/lib/chef/resource/windows_path.rb
+++ b/lib/chef/resource/windows_path.rb
@@ -72,7 +72,7 @@ class Chef
env "path" do
action :modify
delim ::File::PATH_SEPARATOR
- value path.tr("/", '\\')
+ value path.tr("/", "\\")
end
end
@@ -84,7 +84,7 @@ class Chef
env "path" do
action :delete
delim ::File::PATH_SEPARATOR
- value path.tr("/", '\\')
+ value path.tr("/", "\\")
end
end
end
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb
index 6d124f7fcf..ad6c0b249e 100644
--- a/lib/chef/resource/windows_security_policy.rb
+++ b/lib/chef/resource/windows_security_policy.rb
@@ -118,13 +118,13 @@ class Chef
policy_line = "#{security_option} = \"#{security_value}\""
file.write("[Unicode]\r\nUnicode=yes\r\n[System Access]\r\n#{policy_line}\r\n[Version]\r\nsignature=\"$CHICAGO$\"\r\nRevision=1\r\n")
file.close
- file_path = file.path.tr("/", '\\')
+ file_path = file.path.tr("/", "\\")
cmd = "C:\\Windows\\System32\\secedit /configure /db C:\\windows\\security\\new.sdb /cfg #{file_path} /areas SECURITYPOLICY"
else
policy_line = "#{security_option} = #{security_value}"
file.write("[Unicode]\r\nUnicode=yes\r\n[System Access]\r\n#{policy_line}\r\n[Version]\r\nsignature=\"$CHICAGO$\"\r\nRevision=1\r\n")
file.close
- file_path = file.path.tr("/", '\\')
+ file_path = file.path.tr("/", "\\")
cmd = "C:\\Windows\\System32\\secedit /configure /db C:\\windows\\security\\new.sdb /cfg #{file_path} /areas SECURITYPOLICY"
end
shell_out!(cmd)
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb
index c3eb627a4e..7864ff6c22 100644
--- a/lib/chef/resource/windows_task.rb
+++ b/lib/chef/resource/windows_task.rb
@@ -549,7 +549,7 @@ class Chef
if @current_resource.exists
task.get_task(new_resource.task_name)
@current_resource.task = task
- pathed_task_name = new_resource.task_name.start_with?('\\') ? new_resource.task_name : "\\#{new_resource.task_name}"
+ pathed_task_name = new_resource.task_name.start_with?("\\") ? new_resource.task_name : "\\#{new_resource.task_name}"
@current_resource.task_name(pathed_task_name)
end
@current_resource
diff --git a/lib/chef/run_lock.rb b/lib/chef/run_lock.rb
index 1f83b7ea5a..8382983ca0 100644
--- a/lib/chef/run_lock.rb
+++ b/lib/chef/run_lock.rb
@@ -173,7 +173,7 @@ class Chef
# Mutex name is case-sensitive contrary to other things in
# windows. "\" is the only invalid character.
def acquire_win32_mutex
- @mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.tr('\\', "/").downcase}")
+ @mutex = Chef::ReservedNames::Win32::Mutex.new("Global\\#{runlock_file.tr("\\", "/").downcase}")
mutex.test
end
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index 7d1222e8e2..628f6934d8 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.1.30")
+ VERSION = Chef::VersionString.new("17.1.35")
end
#
diff --git a/omnibus/config/software/more-ruby-cleanup.rb b/omnibus/config/software/more-ruby-cleanup.rb
index 663fc71e42..b875c8a166 100644
--- a/omnibus/config/software/more-ruby-cleanup.rb
+++ b/omnibus/config/software/more-ruby-cleanup.rb
@@ -43,7 +43,7 @@ build do
block "Removing additional non-code files from installed gems" do
# find the embedded ruby gems dir and clean it up for globbing
- target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr('\\', "/")
+ target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr("\\", "/")
files = %w{
.rspec-tm
.sitearchdir.time
@@ -82,7 +82,7 @@ build do
block "Removing Gemspec / Rakefile / Gemfile unless there's a bin dir / not a chef gem" do
# find the embedded ruby gems dir and clean it up for globbing
- target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr('\\', "/")
+ target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr("\\", "/")
files = %w{
Gemfile
Rakefile
@@ -102,7 +102,7 @@ build do
end
block "Removing spec dirs from non-Chef gems" do
- Dir.glob("#{install_dir}/embedded/lib/ruby/gems/*/gems/*/spec".tr('\\', "/")).each do |f|
+ Dir.glob("#{install_dir}/embedded/lib/ruby/gems/*/gems/*/spec".tr("\\", "/")).each do |f|
# if we're in a chef- gem then don't remove the specs
next if File.basename(File.expand_path("..", f)).start_with?("chef-")
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index a682e9c0c7..279f8ac8d4 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -72,7 +72,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do
end
def windows_domain_user?(user_name)
- domain, user = user_name.split('\\')
+ domain, user = user_name.split("\\")
if user && domain != "."
computer_name = ENV["computername"]
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index c1de3bf99d..734897aaa4 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -84,7 +84,7 @@ describe Chef::Resource::Link do
end
def canonicalize(path)
- windows? ? path.tr("/", '\\') : path
+ windows? ? path.tr("/", "\\") : path
end
def symlink(a, b)
diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb
index 09e4fdccb4..3e929d22f7 100644
--- a/spec/functional/resource/remote_file_spec.rb
+++ b/spec/functional/resource/remote_file_spec.rb
@@ -155,7 +155,7 @@ describe Chef::Resource::RemoteFile do
before do
shell_out("net.exe share #{smb_share_name} /delete")
File.write(smb_file_local_path, smb_file_content )
- shell_out!("net.exe share #{smb_share_name}=\"#{smb_share_root_directory.tr("/", '\\')}\" /grant:\"authenticated users\",read")
+ shell_out!("net.exe share #{smb_share_name}=\"#{smb_share_root_directory.tr("/", "\\")}\" /grant:\"authenticated users\",read")
end
after do
diff --git a/spec/functional/resource/windows_env_spec.rb b/spec/functional/resource/windows_env_spec.rb
index bbcbf393e2..4d77ee34bd 100644
--- a/spec/functional/resource/windows_env_spec.rb
+++ b/spec/functional/resource/windows_env_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Resource::WindowsEnv, :windows_only do
if environment_variables && environment_variables.length > 0
environment_variables.each do |env|
env_obj = env.wmi_ole_object
- return env_obj if env_obj.username.split('\\').last.casecmp(test_resource.user) == 0
+ return env_obj if env_obj.username.split("\\").last.casecmp(test_resource.user) == 0
end
end
nil
@@ -93,7 +93,7 @@ describe Chef::Resource::WindowsEnv, :windows_only do
test_resource.value(env_value1)
test_resource.user(env_user)
test_resource.run_action(:create)
- expect(env_obj.username.split('\\').last.upcase).to eq(env_user)
+ expect(env_obj.username.split("\\").last.upcase).to eq(env_user)
end
context "when env variable exist with same name" do
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 3738c4a41e..f11dee47b6 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -43,7 +43,7 @@ end
# This is a helper to canonicalize paths that we're using in the file
# tests.
def canonicalize_path(path)
- windows? ? path.tr("/", '\\') : path
+ windows? ? path.tr("/", "\\") : path
end
# Makes a temp directory with a canonical path on any platform.
diff --git a/spec/support/shared/functional/execute_resource.rb b/spec/support/shared/functional/execute_resource.rb
index 9d1c29dfac..62f3f19a2b 100644
--- a/spec/support/shared/functional/execute_resource.rb
+++ b/spec/support/shared/functional/execute_resource.rb
@@ -58,7 +58,7 @@ shared_context "a command that can be executed as an alternate user" do
include Chef::Mixin::ShellOut
before do
- shell_out!("icacls \"#{script_output_dir.tr("/", '\\')}\" /grant \"authenticated users:(F)\"")
+ shell_out!("icacls \"#{script_output_dir.tr("/", "\\")}\" /grant \"authenticated users:(F)\"")
end
after do
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb
index 654765e82d..dccfd5d027 100644
--- a/spec/support/shared/unit/provider/file.rb
+++ b/spec/support/shared/unit/provider/file.rb
@@ -36,7 +36,7 @@ end
# forwards-vs-reverse slashes on windows sucks
def windows_path
- windows? ? normalized_path.tr('\\', "/") : normalized_path
+ windows? ? normalized_path.tr("\\", "/") : normalized_path
end
# this is all getting a bit stupid, CHEF-4802 cut to remove all this
diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb
index eebf0a9d07..4ab4c57094 100644
--- a/spec/unit/provider/link_spec.rb
+++ b/spec/unit/provider/link_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Resource::Link do
end
def canonicalize(path)
- ChefUtils.windows? ? path.tr("/", '\\') : path
+ ChefUtils.windows? ? path.tr("/", "\\") : path
end
describe "when the target is a symlink" do