summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-25 00:25:28 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-25 00:25:28 +0000
commitb119a7252face5ad093a6bd1856f8391cddcc4c4 (patch)
tree3dbf53e73bc021c7a572f2b4a4843d35b4658b1f /lib
parent772c7c87ffab1b7a70413fa6bbd20df45490dbf2 (diff)
downloadpuppet-b119a7252face5ad093a6bd1856f8391cddcc4c4.tar.gz
puppet-b119a7252face5ad093a6bd1856f8391cddcc4c4.tar.xz
puppet-b119a7252face5ad093a6bd1856f8391cddcc4c4.zip
Fixing output when user/group are not found
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@946 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 1d5aff4d1..419b4892e 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -73,6 +73,9 @@ module Util
def self.chuser
if group = Puppet[:group]
group = self.gid(group)
+ unless group
+ raise Puppet::Error, "No such group %s" % Puppet[:group]
+ end
unless Process.gid == group
begin
Process.egid = group
@@ -86,6 +89,9 @@ module Util
if user = Puppet[:user]
user = self.uid(user)
+ unless user
+ raise Puppet::Error, "No such user %s" % Puppet[:user]
+ end
unless Process.uid == user
begin
Process.euid = user
@@ -168,6 +174,9 @@ module Util
end
if obj
gid = obj.should(:gid) || obj.is(:gid)
+ if gid == :absent
+ gid = nil
+ end
end
return gid
@@ -206,7 +215,10 @@ module Util
if obj
obj.retrieve
- uid = obj.is(:uid)
+ uid = obj.should(:uid) || obj.is(:uid)
+ if uid == :absent
+ uid = nil
+ end
end
return uid