diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-15 19:22:36 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-15 19:22:36 +0000 |
| commit | dbedcd7b9892bc41728a4f334464f152d09d54fc (patch) | |
| tree | 66e06fa8fec48ea00491a728ed24906e6b810812 /lib/puppet/util | |
| parent | 28f7d6c7ebd56da3014464c82c73a4f98f3406ea (diff) | |
A round of fixes so unit tests pass; most of the failures were from the merging of the transaction-refactor branch
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2517 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/util')
| -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$ |
