diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-11-29 11:22:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-29 11:22:35 -0800 |
commit | 782f6c5ebc5fd4f9eda3e0e2aa537232de658320 (patch) | |
tree | c4e256e72e046926f59538216f778358f0376b94 | |
parent | 4e656e45c8b55bf8dd8dea80786a2121bbc36cde (diff) | |
parent | 0007a10cde1d189275e0eb28e149bb6d4e0b96c8 (diff) | |
download | chef-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.rb | 10 | ||||
-rw-r--r-- | spec/unit/resource/windows_path_spec.rb | 2 |
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 |