Actions
User story #3014
closedOptionnal variables should not be nulled (if they are not system variables)
Status:
Released
Priority:
N/A
Assignee:
Category:
Web - Config management
Target version:
Pull Request:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:
Description
When we use an optionnal fields in Technique, there are two differents behaviour that are confusing :
Using the same parameters than the files:
- if there is only one value for this field, and it is empty, the generated value is a "null" (nothing)
- if there are several values for this fields, all the empty values are replaced by "" (empty string)
This lead to unexpected behaviour, as both are clearly different
We should clarify this behaviour, surely by having one "optional" field that replaced empty value by "" , and on that is replaced by null and that can't be multivalued
Under is a technical details of what happen on the technique generatin sideUsing the same parameters than the files:
- EnforceFileContentExpandVarBug1.png
- EnforceFileContentExpandVarBug2.png
It will lead to a CFEngine promise generated without variable generic_file_content_modification_destination:
debian-5-64:~# grep 'generic_file_content_modification_destination' /var/rudder/cfengine-community/inputs/checkGenericFileContent/3.0/checkGenericFileContent.cf "replacement_dest_defined_$(index)" expression => isvariable("generic_file_content_modification_destination[$(index)]"); edit_line => set_arbitrary_file_content_modify("$(generic_file_content_modification_regexp[$(index)])", "$(generic_file_content_modification_destination[$(index)])"),Adding a new Directive with the same parameters than the files:
- EnforceFileContentExpandVarBug1.png
- EnforceFileContentExpandVarBug1.png
debian-5-64:~# grep 'generic_file_content_modification_destination' /var/rudder/cfengine-community/inputs/checkGenericFileContent/3.0/checkGenericFileContent.cf "generic_file_content_modification_destination[1]" string => ""; "generic_file_content_modification_destination[2]" string => ""; "replacement_dest_defined_$(index)" expression => isvariable("generic_file_content_modification_destination[$(index)]"); edit_line => set_arbitrary_file_content_modify("$(generic_file_content_modification_regexp[$(index)])", "$(generic_file_content_modification_destination[$(index)])"),
It seems that this is linked to the application instead of the Techniques (#2819).
Files
Actions