diff options
Diffstat (limited to 'lib/puppet/util/posix.rb')
-rwxr-xr-x | lib/puppet/util/posix.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/util/posix.rb b/lib/puppet/util/posix.rb index 9131b394d..06df632a9 100755 --- a/lib/puppet/util/posix.rb +++ b/lib/puppet/util/posix.rb @@ -3,6 +3,9 @@ module Puppet::Util::POSIX # Retrieve a field from a POSIX Etc object. The id can be either an integer # or a name. This only works for users and groups. def get_posix_field(space, field, id) + unless id + raise ArgumentError, "Did not get id" + end if id =~ /^\d+$/ id = Integer(id) end @@ -37,7 +40,7 @@ module Puppet::Util::POSIX obj = typeklass.find { |obj| if id =~ /^\d+$/ obj.should(chkfield).to_s == id || - obj.is(chkfield).to_s == id + obj.provider.send(chkfield) == id else obj[:name] == id end @@ -84,4 +87,4 @@ module Puppet::Util::POSIX end end -# $Id$
\ No newline at end of file +# $Id$ |