summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNAshwini <ashwini.nehate@msystechnologies.com>2018-08-10 19:18:42 +0530
committerNAshwini <ashwini.nehate@msystechnologies.com>2018-08-10 19:18:42 +0530
commiteb35186becde7933a15d98cab1401ee0d795200d (patch)
treef5001e6de38898c3b3035bb817e9d53598a15e12
parentecde4267878799df5bbfe2c4f2bf2297c73bd865 (diff)
downloadchef-eb35186becde7933a15d98cab1401ee0d795200d.tar.gz
Fix issue of setting comment for windows user
Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
-rw-r--r--lib/chef/provider/user/windows.rb4
-rw-r--r--spec/unit/provider/user/windows_spec.rb6
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