Changed 'plugins' directory name to 'lib' to reflect changes in 0.25+ puppet server.

This commit is contained in:
Timo Mkinen 2010-04-17 18:26:02 +03:00
parent 05b0b8ab70
commit 24000d595c
6 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,26 @@
module Puppet::Parser::Functions
newfunction(:avahi_service_port, :type => :rvalue) do |args|
type, name, proto = /^_([^\.]*)\._([^\.]*)$/.match(args[0]).to_a
port = nil
File.open('/etc/services', 'r') do |fd|
while (line = fd.gets)
begin
port = /^#{name}[ \t]+(\d+)\/#{proto}.*/.match(line)[1]
break
rescue
nil
end
end
end
if not port
raise Puppet::ParseError, 'Failed to get port for service %s' % type
end
port
end
end