From 04640245add49e05543785d5aa241f1aed6088cb Mon Sep 17 00:00:00 2001 From: Mendy Baitelman <10748279+mbaitelman@users.noreply.github.com> Date: Tue, 13 Nov 2018 14:37:29 -0800 Subject: [PATCH] Mark windows template sensitive if setting password, remove default '.' for windows users domain Signed-off-by: Mendy Baitelman --- libraries/slave_windows.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/slave_windows.rb b/libraries/slave_windows.rb index b172569eaf..0e905e40ab 100644 --- a/libraries/slave_windows.rb +++ b/libraries/slave_windows.rb @@ -184,6 +184,7 @@ def slave_xml_resource @slave_xml_resource = Chef::Resource::Template.new(slave_xml, run_context) @slave_xml_resource.cookbook('jenkins') @slave_xml_resource.source('jenkins-slave.xml.erb') + @slave_xml_resource.sensitive = true if new_resource.password @slave_xml_resource.variables( new_resource: new_resource, endpoint: endpoint, @@ -263,7 +264,7 @@ def service_resource end # - # Windows domain for the user or `.` if a domain is not set. + # Windows domain for the user or nil if there is no domain. # # @return [String] # @@ -271,8 +272,6 @@ def user_domain @user_domain ||= begin if (parts = new_resource.user.match(/(?.*)\\(?.*)/)) parts[:domain] - else - '.' end end end