diff options
author | vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2018-09-24 11:18:05 +0530 |
---|---|---|
committer | vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2018-09-24 14:32:09 +0530 |
commit | 367f896a6a2b55568844cd1a2bd276a13d4e0722 (patch) | |
tree | fd839cfa3bf837e49842ceb4db43c0a3bb367ff0 /lib/chef | |
parent | 859571775d28eb4f2922614abe1114db1a23094e (diff) | |
download | chef-367f896a6a2b55568844cd1a2bd276a13d4e0722.tar.gz |
MSYS-888 Adds full_name property to user resource for Windows.
Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/user/windows.rb | 7 | ||||
-rw-r--r-- | lib/chef/resource/user/windows_user.rb | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 849382b363..f393b81919 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -39,12 +39,12 @@ class Chef logger.warn("The 'gid' (or 'group') property is not implemented on the Windows platform. Please use the `members` property of the 'group' resource to assign a user to a group.") end - @current_resource = Chef::Resource::User.new(new_resource.name) + @current_resource = Chef::Resource::User::WindowsUser.new(new_resource.name) current_resource.username(new_resource.username) begin user_info = @net_user.get_info - current_resource.uid(user_info[:user_id]) + current_resource.full_name(user_info[:full_name]) current_resource.comment(user_info[:comment]) current_resource.home(user_info[:home_dir]) current_resource.shell(user_info[:script_path]) @@ -67,7 +67,7 @@ class Chef logger.trace("#{new_resource} password has changed") return true end - [ :uid, :comment, :home, :shell ].any? do |user_attrib| + [ :uid, :comment, :home, :shell, :full_name ].any? do |user_attrib| !new_resource.send(user_attrib).nil? && new_resource.send(user_attrib) != current_resource.send(user_attrib) end end @@ -100,6 +100,7 @@ class Chef opts = { name: new_resource.username } field_list = { + "full_name" => "full_name", "comment" => "comment", "home" => "home_dir", "uid" => "user_id", diff --git a/lib/chef/resource/user/windows_user.rb b/lib/chef/resource/user/windows_user.rb index baedc14f5e..da50467998 100644 --- a/lib/chef/resource/user/windows_user.rb +++ b/lib/chef/resource/user/windows_user.rb @@ -25,6 +25,9 @@ class Chef provides :windows_user provides :user, os: "windows" + + property :full_name, String, + description: "The full name of the user." end end end |