64: def self.jobsearch(label=nil)
65: label_to_path_map = {}
66: Launchd_Paths.each do |path|
67: if FileTest.exists?(path)
68: Dir.entries(path).each do |f|
69: next if f =~ /^\..*$/
70: next if FileTest.directory?(f)
71: fullpath = File.join(path, f)
72: if FileTest.file?(fullpath) and job = read_plist(fullpath) and job.has_key?("Label")
73: if job["Label"] == label
74: return { label => fullpath }
75: else
76: label_to_path_map[job["Label"]] = fullpath
77: end
78: end
79: end
80: end
81: end
82:
83:
84: raise Puppet::Error.new("Unable to find launchd plist for job: #{label}") if label
85:
86: label_to_path_map
87: end