summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user/useradd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/provider/user/useradd.rb')
-rw-r--r--lib/chef/provider/user/useradd.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/chef/provider/user/useradd.rb b/lib/chef/provider/user/useradd.rb
index 68b62812a7..3fef8d3642 100644
--- a/lib/chef/provider/user/useradd.rb
+++ b/lib/chef/provider/user/useradd.rb
@@ -23,7 +23,7 @@ class Chef
class Provider
class User
class Useradd < Chef::Provider::User
- # MAJOR XXX: this should become the base class of all Useradd providers instead of the linux implementation
+ provides :user
UNIVERSAL_OPTIONS = [[:comment, "-c"], [:gid, "-g"], [:password, "-p"], [:shell, "-s"], [:uid, "-u"]]
@@ -116,15 +116,15 @@ class Chef
update_options(field, option, opts)
end
if updating_home?
- opts << "-d" << new_resource.home
if managing_home_dir?
Chef::Log.debug("#{new_resource} managing the users home directory")
- opts << "-m"
+ opts << "-d" << new_resource.home << "-m"
else
Chef::Log.debug("#{new_resource} setting home to #{new_resource.home}")
+ opts << "-d" << new_resource.home
end
end
- opts << "-o" if new_resource.non_unique
+ opts << "-o" if new_resource.non_unique || new_resource.supports[:non_unique]
opts
end
end
@@ -141,7 +141,6 @@ class Chef
def useradd_options
opts = []
opts << "-r" if new_resource.system
- opts << "-M" unless managing_home_dir?
opts
end