puppet 4 foo
[mirror/dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / onion_balance_service_hostname.rb
index 75cb033..8a4a9f4 100644 (file)
@@ -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)