Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Should we start explicitly using top-scope in class names?

I've recently run into a strange situation with two modules:

1) an ubuntu module, with an ubuntu class.

2) a site module, that I use as glue to connect other modules together. It has a main class spencer and a subclass spencer::ubuntu.

If I write

include ubuntu

in my spencer class. It will include not the ubuntu class from the ubuntu module, as I would expect it to, but instead it will include the 'spencer::ubuntu' class. This is most likely following from the 'most local' principle of variable scoping.

If I want the ubuntu class from the ubuntu module I can explicitly use top scope as so:

include ::ubuntu

My question is this:

Is this behavior a bug? Should it be fixed? Are other people already counting on this behavior(perhaps without even knowing?) Or is this expected behavior and I(or we) should start using the '::classname' syntax in our Puppet manifests?