summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-08-13 10:40:24 -0700
committerGitHub <noreply@github.com>2018-08-13 10:40:24 -0700
commitdd6edde0c5906802a6fa0c5be4d83ee9c3f51b6c (patch)
tree06872c71db9296bd5bd969f8feb6ae98723a3184
parent71d515800cdcda1629a1b644e808ee753ce6f8b4 (diff)
parenteb35186becde7933a15d98cab1401ee0d795200d (diff)
downloadchef-dd6edde0c5906802a6fa0c5be4d83ee9c3f51b6c.tar.gz
Merge pull request #7537 from MsysTechnologiesllc/ash/MSYS-880_Fix_issue_of_setting_comment_for_windows_user
Fix issue of setting comment for windows user
-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