fix variable scope issues
fix variable scope issues

envato/puppet-riemann,krakatoa/garethr-riemann,krakatoa/garethr-riemann,udacity/garethr-riemann,envato/puppet-riemann,krakatoa/garethr-riemann,garethr/garethr-riemann,udacity/garethr-riemann,envato/puppet-riemann,udacity/garethr-riemann