buildd user exists facter
authorPeter Palfrader <peter@palfrader.org>
Sat, 14 Feb 2015 21:38:35 +0000 (22:38 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 14 Feb 2015 21:38:35 +0000 (22:38 +0100)
modules/debian-org/lib/facter/roleaccounts.rb

index bb652f8..c2c778b 100644 (file)
@@ -50,6 +50,7 @@ begin
         end
     end
 
+
     Facter.add("buildd_key") do
         setcode do
             key = nil
@@ -61,6 +62,19 @@ begin
         end
     end
 
+    Facter.add("buildd_user_exists") do
+        setcode do
+            result = ''
+            begin
+                if Etc.getpwnam('buildd')
+                    result = true
+                end
+            rescue ArgumentError
+            end
+            result
+        end
+    end
+
 
 rescue Exception => e
 end