New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add private() function #270
Conversation
nice! |
👍 |
hm... this was added, but "private" is a reserved keyword in future parser in 3.7, and is an error in Puppet 4.0.0 until support for this has been added to the language for classes, defines, and variables (planned for 4.x). This function can then not be called because its name is reserved. |
You can achieve this without this function: |
Hi @hlindberg, It's good to know that the future parser will have a |
The future language concept "private" covers the functionality of this function. My suggestion is to not include the function in standard lib at all. |
How about keeping it and specifying that it will be deprecated in Puppet 4? |
So people have to change their code first to use it, and then change it? At least rename it. |
What is the syntax of the private statement in the future parser? |
@raphink it isn't in yet, at this point we've just reserved the word, but it'll likely be something like |
OK. What do you suggest for a renaming? |
@raphink how about I'd also suggest checking for the puppet version, and issue a warning for >= 4. |
Some suggestions, |
As mentioned in puppetlabs#270, private is a reserved keyword in the future parser which is to be released with Puppet 4. As it stands, this function is not useable with the future parser so it needs to renamed. This is a breaking change.
As mentioned in puppetlabs#270, private is a reserved keyword in the future parser which is to be released with Puppet 4. As it stands, this function is not useable with the future parser so it needs to renamed. This is a breaking change.
private
This function sets the current class or definition as private.
Calling the class or definition from outside the current module will fail.
Examples:
called in class
foo::bar
will output the following message if class is calledfrom outside module
foo
:You can specify the error message you want to use as a parameter: