Bug #3640
closed
Variable definition is not valid
Added by Cedric JARDIN over 11 years ago.
Updated over 9 years ago.
Description
Hello,
In Directive/Generic CFEngine variable Definition, We can't use a "variable name" with one dot inside.
Exemple : Variable name = "test.varia"
ERROR DISPLAYED :
"The form contains some errors, please correct them.
Please modify Variable name to match the requested format : Please enter a valid CFengine variable name"
NB => Rudder Version : 2.6.2
- Status changed from New to Discussion
- Assignee set to François ARMAND
Hello,
Dots are not allowed in in the variable name (that's not allowed by CFEngine itself). But regarding the directive form, I can see what you may have misunderstood given the text:
Configures a generic CFEngine variable in a common bundle, to be used in another Technique. This Technique does nothing by itself, you must reuse the variable(s) you will create here in another Technique with the form: ${generic_variable_definition.variablename}
In the above description, "generic_variable_definition" is to be taken literaly. So if you entered for the field variable name "foo", you will use: "${generic_variable_definition.foo}".
Does that help? If so, I will update the bug to "change the CFEngine variable directive description so that it is not misleading".
Hello,
It was working on Rudder v2.5.3 and we got a lot of variable with dot in their name.
- Project changed from 34 to 24
- Assignee changed from François ARMAND to Nicolas CHARLES
OK... Then I will ask for a Jocker. Nicolas, could you please take a look to that one ?
This is interresting; the CFEngine documentation explicitely states that variable can contain only letters, digits and underscore ( http://cfengine.com/manuals/cf3-Reference#Syntax )
In the general case, using a dot in a variable fails; however, in the specific case of the Generic CFEngine variable Definition (a definition in a bundle common, refered from another bundle), it works, while it shouldn't.
We fixed the regexp to check the validity of the variable name on May 17th 2013 (ticket #3599), that's why you were able to use dot before this fix.
This CFEngine documentation clearly states that dot is not allowed in variable name, we won't support the dot in variable name.
We strongly suggests that you replace the dot by underscore in the directives based on Generic CFEngine variable Definition and on all directives using this. A migration script will be created for the next release.
- Category set to Techniques
- Status changed from Discussion to Rejected
- Project changed from 24 to Rudder
- Category changed from Techniques to Techniques
Also available in: Atom
PDF