From eb35186becde7933a15d98cab1401ee0d795200d Mon Sep 17 00:00:00 2001 From: NAshwini Date: Fri, 10 Aug 2018 19:18:42 +0530 Subject: Fix issue of setting comment for windows user Signed-off-by: NAshwini --- lib/chef/provider/user/windows.rb | 4 ++-- spec/unit/provider/user/windows_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 994f1a6774..849382b363 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -45,7 +45,7 @@ class Chef user_info = @net_user.get_info current_resource.uid(user_info[:user_id]) - current_resource.comment(user_info[:full_name]) + current_resource.comment(user_info[:comment]) current_resource.home(user_info[:home_dir]) current_resource.shell(user_info[:script_path]) rescue Chef::Exceptions::UserIDNotFound => e @@ -100,7 +100,7 @@ class Chef opts = { name: new_resource.username } field_list = { - "comment" => "full_name", + "comment" => "comment", "home" => "home_dir", "uid" => "user_id", "shell" => "script_path", diff --git a/spec/unit/provider/user/windows_spec.rb b/spec/unit/provider/user/windows_spec.rb index dab4814d44..76234def1a 100644 --- a/spec/unit/provider/user/windows_spec.rb +++ b/spec/unit/provider/user/windows_spec.rb @@ -65,7 +65,7 @@ describe Chef::Provider::User::Windows do describe "and the properties match" do it "doesn't set the comment field to be updated" do - expect(@provider.set_options).not_to have_key(:full_name) + expect(@provider.set_options).not_to have_key(:comment) end it "doesn't set the home directory to be updated" do @@ -102,8 +102,8 @@ describe Chef::Provider::User::Windows do @provider.current_resource = @current_resource end - it "marks the full_name field to be updated" do - expect(@provider.set_options[:full_name]).to eq("Adam Jacob") + it "marks the comment field to be updated" do + expect(@provider.set_options[:comment]).to eq("Adam Jacob") end it "marks the home_dir property to be updated" do -- cgit v1.2.1