summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-11-29 11:22:35 -0800
committerGitHub <noreply@github.com>2017-11-29 11:22:35 -0800
commit782f6c5ebc5fd4f9eda3e0e2aa537232de658320 (patch)
treec4e256e72e046926f59538216f778358f0376b94
parent4e656e45c8b55bf8dd8dea80786a2121bbc36cde (diff)
parent0007a10cde1d189275e0eb28e149bb6d4e0b96c8 (diff)
downloadchef-782f6c5ebc5fd4f9eda3e0e2aa537232de658320.tar.gz
Merge pull request #6541 from chef/path_idempotency
Fix windows_path converging on every run
-rw-r--r--lib/chef/provider/windows_path.rb10
-rw-r--r--spec/unit/resource/windows_path_spec.rb2
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/chef/provider/windows_path.rb b/lib/chef/provider/windows_path.rb
index b31789b4b9..e31ecaf2a0 100644
--- a/lib/chef/provider/windows_path.rb
+++ b/lib/chef/provider/windows_path.rb
@@ -37,12 +37,10 @@ class Chef
# the PATH environment variable. Ruby expects these to be expanded.
#
path = expand_path(new_resource.path)
- converge_by "Adding #{new_resource.path} to path environment variable" do
- declare_resource(:env, "path") do
- action :modify
- delim ::File::PATH_SEPARATOR
- value path.tr("/", '\\')
- end
+ declare_resource(:env, "path") do
+ action :modify
+ delim ::File::PATH_SEPARATOR
+ value path.tr("/", '\\')
end
end
diff --git a/spec/unit/resource/windows_path_spec.rb b/spec/unit/resource/windows_path_spec.rb
index aecea8ee6b..e48e9e14ae 100644
--- a/spec/unit/resource/windows_path_spec.rb
+++ b/spec/unit/resource/windows_path_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Resource::WindowsPath do
expect(subject.resource_name).to eql(:windows_path)
end
- it "sets the path as it's name" do
+ it "sets the path as its name" do
expect(subject.path).to eql("some_path")
end