From: Tollef Fog Heen Date: Thu, 2 Jan 2014 17:44:31 +0000 (+0100) Subject: Log error rather than exploding unhelpfully X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=sidebyside;h=544c654f232dc48c78c38407aa8a1c97425ec131;p=dsa-puppet.git Log error rather than exploding unhelpfully --- diff --git a/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb b/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb index a8f9fd3a..64633ced 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb @@ -4,6 +4,10 @@ module Puppet::Parser::Functions role = args.shift roles = lookupvar('site::roles') fqdn = lookupvar('fqdn') + if not roles.include?(role) + error "Failed to look up missing role #{role}" + return False + end return roles[role].include?(fqdn) end end