Issue #1198 has been updated by Henrik Lindberg.

With eparser it is certainly possible to validate differently based on settings 
(i.e. "ignore", "warning", "error") for certain types of potential problems.
At the same time it is important that there is interoperability between newer 
and older code (needs to be determined at module level).
There are also semantic issues where missing values have semantic meaning - 
e.g. a fact is not delivered at all and there is no trace of the variable, the 
name is still valid and the result of evaluting it should :undef
as oppose to an error. Pair that with the (still) odd scoping rules to end up 
with a situation that is problematic to solve.

We are on a track where we will be able to solve this (cleanup part by part of 
the logic), but I am at this point uncertain what restrictions/inconveniences 
that may need to be enforced to be authoritative about if a variable exists or 
not.

----------------------------------------
Feature #1198: alter parser to throw an error on use of an undefined, unquoted, 
variable.
https://projects.puppetlabs.com/issues/1198#change-91774

* Author: Mike Pountney
* Status: Accepted
* Priority: Normal
* Assignee: eric sorenson
* Category: language
* Target version: 3.x
* Affected Puppet version: 0.25.4
* Keywords: customer
* Branch: 
----------------------------------------
Currently, the parser treats the following cases as equivalent:

<pre>

file {"/tmp/testfile":
    content => $content
}

file {"/tmp/testfile":
    content => "$content"
}

</pre>

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... 



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to