handle fact not yet existing
[mirror/dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / onion_balance_service_hostname.rb
index be2d1cb..8a4a9f4 100644 (file)
@@ -4,6 +4,7 @@ module Puppet::Parser::Functions
     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)