On Fri, Mar 10, 2017, at 14:06, Dirk Heinrichs wrote:
> Am 10.03.2017 um 14:02 schrieb R.I.Pienaar:
> 
> > the first is just wrong
> 
> OTOH, I mostly use $::facts['fact_name'].

this is not needed.

The reason you use $::foo is because of the problem here:

  $foo = "top"
  class x($foo="class") { 
    notice($foo)
    notice($::foo)
  }

  include x

this produce:

Notice: Scope(Class[X]): class
Notice: Scope(Class[X]): top

you need to guard against the accidental $foo which used to be much
worse with dynamic scope, so the code got littered with all this ::
rubbish.

$facts is globally reserved

  class x {
    $facts = {}
  }

  include x

Error: Evaluation Error: Error while evaluating a '=' expression,
Attempt to assign to a reserved variable name: 'facts'

You can never cause the problem that raised the need for $::facts to
exist, you can just use $facts and it's all sweet and

In general with Puppet 4 the needs for all the :: stuff is almost all
gone

-- 
R.I.Pienaar / www.devco.net / @ripienaar

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1489151425.3162917.906957512.5D8D0563%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to