#1198: alter parser to throw an error on use of an undefined, unquoted,
variable.
------------------------+---------------------------------------------------
Reporter: mike | Owner: community
Type: enhancement | Status: new
Priority: normal | Component: language
Version: | Severity: normal
Keywords: | Stage: Unreviewed
Patch: None | Complexity: Unknown
------------------------+---------------------------------------------------
Currently, the parser treats the following cases as equivalent:
{{{
file {"/tmp/testfile":
content => $content
}
file {"/tmp/testfile":
content => "$content"
}
}}}
I think it would be beneficial to throw a compile error in the first case
if $content is not defined, eg fail('Attempt to use unquoted, undefined
variable $content'). This would sensibly catch many cases where I have:
* typo'd on variable names,
* misjudged scoping,
* forgotten to define a variable that I am using in a defined type,
* broken a facter fact.
The second form provides a means for people to continue with the current
logic of 'all variables are an empty string if undefined' for such things
as 'if "$myvar"' statements.
Anyway, please feel free to tell me that this ain't gonna happen, just
wanted to throw it out there...
--
Ticket URL: <http://reductivelabs.com/trac/puppet/ticket/1198>
puppet <http://reductivelabs.com>
Puppet - Portable System Automation
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---