Skip to content

Commit

Permalink
Revert "Merge pull request #694 from DataDog/julien.lebot/fix_credent…
Browse files Browse the repository at this point in the history
…ials_leak"

This reverts commit fa40d3d, reversing
changes made to 018ff8b.
  • Loading branch information
kbogtob committed Mar 3, 2020
1 parent 8d24fd5 commit 8a5906d
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions recipes/_install-windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@
# limitations under the License.
#

include_recipe 'chef_handler'

module Windows
class Helper
def do_cleanup(context)
Chef::Log.info 'Windows environment vars cleanup started.'
resource = context.resource_collection.lookup('windows_env[DDAGENTUSER_NAME]')
resource.run_action(:delete) if resource
resource = context.resource_collection.lookup('windows_env[DDAGENTUSER_PASSWORD]')
resource.run_action(:delete) if resource
Chef::Log.info 'Windows environment vars cleanup finished.'
end
end
end

Chef.event_handler do
on :run_failed do
Windows::Helper.new.do_cleanup(
Chef.run_context
)
end
end

dd_agent_version = Chef::Datadog.agent_version(node)

if dd_agent_version.nil?
Expand Down Expand Up @@ -167,10 +144,8 @@ def do_cleanup(context)

windows_env 'DDAGENTUSER_NAME' do
action :delete
sensitive true
end

windows_env 'DDAGENTUSER_PASSWORD' do
action :delete
sensitive true
end

0 comments on commit 8a5906d

Please sign in to comment.