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