Sha256: f483abd47b92c2ee4db56f245ff958e3aac3e39a83dfd0d6440c679afc00ba61

Contents?: true

Size: 817 Bytes

Versions: 389

Compression:

Stored size: 817 Bytes

Contents

require 'puppet/provider/nameservice'

class Puppet::Provider::NameService
class ObjectAdd < Puppet::Provider::NameService
  def deletecmd
    [command(:delete), @resource[:name]]
  end

  # Determine the flag to pass to our command.
  def flag(name)
    name = name.intern if name.is_a? String
    self.class.option(name, :flag) || "-" + name.to_s[0,1]
  end

  def modifycmd(param, value)
    cmd = [command(param.to_s =~ /password_.+_age/ ? :password : :modify)]
    cmd << flag(param) << value
    if @resource.allowdupe? && ((param == :uid) || (param == :gid and self.class.name == :groupadd))
      cmd << "-o"
    end
    cmd << @resource[:name]

    cmd
  end

  def posixmethod(name)
    name = name.intern if name.is_a? String
    method = self.class.option(name, :method) || name

    method
  end
end
end

Version data entries

389 entries across 389 versions & 6 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/provider/nameservice/objectadd.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.7 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.7-x86-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.7-x64-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.7-universal-darwin lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.12 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.12-x86-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.12-x64-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.12-universal-darwin lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.11 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.11-x86-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.11-x64-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-4.10.11-universal-darwin lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.6 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.6-x86-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.6-x64-mingw32 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.6-universal-darwin lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.5 lib/puppet/provider/nameservice/objectadd.rb
puppet-5.3.5-x86-mingw32 lib/puppet/provider/nameservice/objectadd.rb