What I was trying to fix is that scope.lookupvar() returns nil instead of undefined in puppet > 2.7 (https://projects.puppetlabs.com/issues/8707) which meant in my case that the manifest would fail to render when the class ceph::conf::osd was called with an empty $osd_id variable.

I see the flaw in my proposed fix, I'm working on a corrected version.