summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander van Harmelen <svanharmelen@schubergphilis.com>2014-04-01 17:56:47 +0200
committerBryan McLellan <btm@getchef.com>2014-06-05 12:38:07 -0700
commit9ab035b9f972061e91db0337497d3a2c71eb3dff (patch)
tree2a84ef9f99d46578fcae9d173679b2619014284e
parent697d84f20a04f55e0d1ed2d7ebb0bc10956f8cad (diff)
downloadchef-9ab035b9f972061e91db0337497d3a2c71eb3dff.tar.gz
Added two lines so changes in the environment variables are can be used in the same chef-run that sets them
These two lines add or remove environment variables from the Ruby ENV object, so that right after setting the new variables you can use them in later steps in the same chef run. Without these lines you need a second chef run if preceding steps depend on the newly added variables.
-rw-r--r--lib/chef/provider/env/windows.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/provider/env/windows.rb b/lib/chef/provider/env/windows.rb
index 297de94083..d0c136451f 100644
--- a/lib/chef/provider/env/windows.rb
+++ b/lib/chef/provider/env/windows.rb
@@ -34,6 +34,7 @@ class Chef
end
obj.variablevalue = @new_resource.value
obj.put_
+ ENV[@new_resource.key_name] = @new_resource.value
broadcast_env_change
end
@@ -41,6 +42,7 @@ class Chef
obj = env_obj(@new_resource.key_name)
if obj
obj.delete_
+ ENV.delete(@new_resource.key_name)
broadcast_env_change
end
end