opscode/chef — pull request #1597 by linkfanel (2014-07-02 16:18:24+00:00)
Title: Don't modify variable passed to env resource when updating

When using a delimiter, the passed value is prepended to the given
environment variable. Unfortunately this has the side effect of modifying
the variable passed to the resource. Oftentimes this is an attribute,
used somewhere else after that, with the wrong, modified value.

Sample code that exhibits the issue:

```ruby
node.default[:foobar] = 'hello'

env 'test' do
value 'bye'
end

env 'test' do
value node[:foobar]
delim ::File::PATH_SEPARATOR
end

ruby_block 'puts' do
block do
Chef::Log.info "foobar: #{node[:foobar]}"
end
end
```

This outputs:

> INFO: foobar: hello;bye