X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fonion_tor_service_hostname.rb;h=ca642da43c23284e100b0cdb204158ecf9067ba5;hb=acc06f8a3b65391b44bbb3b56b17a18bab966c22;hp=4d17eb2986c85d41c8975546e119e90e1955f75e;hpb=705850831e5b2cea9d62f92bb6d234e87572e326;p=mirror%2Fdsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb b/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb index 4d17eb298..ca642da43 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb @@ -1,8 +1,10 @@ +# This function returns the .onion name for a given service name on the local host's tor instance module Puppet::Parser::Functions newfunction(:onion_tor_service_hostname, :type => :rvalue) do |args| servicename = args.shift() onion_tor_service_hostname_fact = lookupvar('onion_tor_service_hostname') + return nil if onion_tor_service_hostname_fact.nil? require 'json' parsed = JSON.parse(onion_tor_service_hostname_fact)