summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider/user/pw.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/provider/user/pw.rb')
-rw-r--r--lib/puppet/provider/user/pw.rb64
1 files changed, 32 insertions, 32 deletions
diff --git a/lib/puppet/provider/user/pw.rb b/lib/puppet/provider/user/pw.rb
index 7d3eda281..345d924bf 100644
--- a/lib/puppet/provider/user/pw.rb
+++ b/lib/puppet/provider/user/pw.rb
@@ -1,41 +1,41 @@
require 'puppet/provider/nameservice/pw'
Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do
- desc "User management via ``pw`` on FreeBSD."
-
- commands :pw => "pw"
- has_features :manages_homedir, :allows_duplicates
-
- defaultfor :operatingsystem => :freebsd
-
- options :home, :flag => "-d", :method => :dir
- options :comment, :method => :gecos
- options :groups, :flag => "-G"
-
- verify :gid, "GID must be an integer" do |value|
- value.is_a? Integer
+ desc "User management via ``pw`` on FreeBSD."
+
+ commands :pw => "pw"
+ has_features :manages_homedir, :allows_duplicates
+
+ defaultfor :operatingsystem => :freebsd
+
+ options :home, :flag => "-d", :method => :dir
+ options :comment, :method => :gecos
+ options :groups, :flag => "-G"
+
+ verify :gid, "GID must be an integer" do |value|
+ value.is_a? Integer
+ end
+
+ verify :groups, "Groups must be comma-separated" do |value|
+ value !~ /\s/
+ end
+
+ def addcmd
+ cmd = [command(:pw), "useradd", @resource[:name]]
+ @resource.class.validproperties.each do |property|
+ next if property == :ensure
+ # the value needs to be quoted, mostly because -c might
+ # have spaces in it
+ if value = @resource.should(property) and value != ""
+ cmd << flag(property) << value
+ end
end
- verify :groups, "Groups must be comma-separated" do |value|
- value !~ /\s/
- end
-
- def addcmd
- cmd = [command(:pw), "useradd", @resource[:name]]
- @resource.class.validproperties.each do |property|
- next if property == :ensure
- # the value needs to be quoted, mostly because -c might
- # have spaces in it
- if value = @resource.should(property) and value != ""
- cmd << flag(property) << value
- end
- end
+ cmd << "-o" if @resource.allowdupe?
- cmd << "-o" if @resource.allowdupe?
+ cmd << "-m" if @resource.managehome?
- cmd << "-m" if @resource.managehome?
-
- cmd
- end
+ cmd
+ end
end