diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-16 14:43:44 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-21 10:54:20 -0700 |
commit | 59282e5d95bbfffa5eaebdaa8b4aba8f8d63acdb (patch) | |
tree | 9abe64c0db086249ba20e01b3e98f26260640121 /lib/chef | |
parent | 8c1be56ff907abef6e8cc6f30734112a2d38db69 (diff) | |
download | chef-59282e5d95bbfffa5eaebdaa8b4aba8f8d63acdb.tar.gz |
Ensure delete ENV[var] from current process
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/env/windows.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/provider/env/windows.rb b/lib/chef/provider/env/windows.rb index 572ec5c633..dd7cb1bc46 100644 --- a/lib/chef/provider/env/windows.rb +++ b/lib/chef/provider/env/windows.rb @@ -43,14 +43,16 @@ class Chef obj = env_obj(@new_resource.key_name) if obj obj.delete_ - ENV.delete(@new_resource.key_name) broadcast_env_change end + if ENV[@new_resource.key_name] + ENV.delete(@new_resource.key_name) + end end def env_value(key_name) obj = env_obj(key_name) - return obj ? obj.variablevalue : nil + return obj ? obj.variablevalue : ENV[key_name] end def env_obj(key_name) |