diff options
| author | Luke Kanies <luke@madstop.com> | 2008-01-14 13:34:06 -0800 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-01-14 13:34:06 -0800 |
| commit | cfda651f88d12249f29706d2bedbfddce7a2e6f7 (patch) | |
| tree | 41c57e5e1405691a561b35b1ceac890c6a341ef3 /lib | |
| parent | 488c43771aea482e0212b605bde054bf8cb0533c (diff) | |
| download | puppet-cfda651f88d12249f29706d2bedbfddce7a2e6f7.tar.gz puppet-cfda651f88d12249f29706d2bedbfddce7a2e6f7.tar.xz puppet-cfda651f88d12249f29706d2bedbfddce7a2e6f7.zip | |
Another round of test-fixes toward eliminating global resource
references. This should have gotten rid of all of them,
and now it's just a question of fixing a few hopefully unrelated
failing tests.
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/user.rb | 14 | ||||
| -rwxr-xr-x | lib/puppet/util/posix.rb | 39 |
2 files changed, 1 insertions, 52 deletions
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 48e35f2c8..98b6a63de 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -299,19 +299,7 @@ module Puppet group end } - groups.each { |group| - case group - when Integer: - if obj = Puppet.type(:group).find { |gobj| - gobj.should(:gid) == group - } - autos << obj - - end - else - autos << group - end - } + autos = groups.reject { |g| g.is_a?(Integer) } end if obj = @parameters[:groups] and groups = obj.should diff --git a/lib/puppet/util/posix.rb b/lib/puppet/util/posix.rb index c518a8797..0b1e1c2f2 100755 --- a/lib/puppet/util/posix.rb +++ b/lib/puppet/util/posix.rb @@ -63,45 +63,6 @@ module Puppet::Util::POSIX return nil end - # Look in memory for an already-managed type and use its info if available. - # Currently unused. - def get_provider_value(type, field, id) - unless typeklass = Puppet::Type.type(type) - raise ArgumentError, "Invalid type %s" % type - end - - id = id.to_s - - chkfield = idfield(type) - obj = typeklass.find { |obj| - if id =~ /^\d+$/ - obj.should(chkfield).to_s == id || - obj.provider.send(chkfield) == id - else - obj[:name] == id - end - } - - return nil unless obj - - if obj.provider - begin - val = obj.provider.send(field) - if val == :absent - return nil - else - return val - end - rescue => detail - if Puppet[:trace] - puts detail.backtrace - Puppet.err detail - return nil - end - end - end - end - # Determine what the field name is for users and groups. def idfield(space) case Puppet::Util.symbolize(space) |
