~ubuntu-branches/ubuntu/lucid/puppet/lucid-security

« back to all changes in this revision

Viewing changes to lib/puppet/type/user.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        @doc = "Manage users.  This type is mostly built to manage system
10
10
            users, so it is lacking some features useful for managing normal
11
11
            users.
12
 
            
 
12
 
13
13
            This resource type uses the prescribed native tools for creating
14
14
            groups and generally uses POSIX APIs for retrieving information
15
15
            about them.  It does not directly modify /etc/passwd or anything."
228
228
                }
229
229
                groups.each { |group|
230
230
                    case group
231
 
                    when Integer:
232
 
                        if obj = Puppet.type(:group).find { |gobj|
233
 
                            gobj.should(:gid) == group
234
 
                        }
235
 
                            autos << obj
236
 
 
 
231
                    when Integer
 
232
                        if resource = catalog.resources.find { |r| r.is_a?(Puppet::Type.type(:group)) and r.should(:gid) == group }
 
233
                            autos << resource
237
234
                        end
238
235
                    else
239
236
                        autos << group
248
245
            autos
249
246
        end
250
247
 
 
248
        # Provide an external hook.  Yay breaking out of APIs.
 
249
        def exists?
 
250
            provider.exists?
 
251
        end
 
252
 
251
253
        def retrieve
252
254
            absent = false
253
255
            properties().inject({}) { |prophash, property|