Actions
Bug #3108
closedbreak rules generation using quotes in a "File content" in a directive like "Enforce a file content"
Status:
Rejected
Priority:
1 (highest)
Assignee:
Matthieu CERDA
Category:
Web - Config management
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
Example:
Create a Directive based on the "Enforce a file content" Technique.
File to manage:
Path:
/etc/apticron/apticron.conf
Enforce the content of the file:
no
File Content:
DIFF_ONLY="1"
(This line of configuration is a simple copy/paste of the expected line)
Save
then: Error: Rules not applied ...
The complete error:
Error Error Deployment process was stopped due to an error: => Deployment error for process '73' at 2012/12/27 11:01:08 => Cannot write configuration node => Error when preparing rules for agents => The generated promises are invalid, cause is: Show technical details Technical details /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:170,57: syntax error, near token '1' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:170,59: Something defined outside of a block or missing punctuation in input, near token '"' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:170,59: syntax error, near token '"' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:170,60: Something defined outside of a block or missing punctuation in input, near token ';' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:170,60: syntax error, near token ';' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,37: Something defined outside of a block or missing punctuation in input, near token 'generic_file_content' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,37: syntax error, near token 'generic_file_content' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,44: Something defined outside of a block or missing punctuation in input, near token 'string' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,44: syntax error, near token 'string' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,47: Something defined outside of a block or missing punctuation in input, near token '=>' /var/rudder/cfengine-community/inputs.new/checkGenericFileContent/3.1/checkGenericFileContent.cf:173,47: syntax error, near token '=>'
If i remove the quotes it will work as expected
File Content not working:
DIFF_ONLY="1"
File Content working:
DIFF_ONLY=1
If this is the expected behaviour, then it should be advertised in the configuration screen, and in the documentation, with some examples of common mistakes and how to avoid them.
As a user, i would like to ba able to make a simple copy/paste of lines of configuration, tough.
Actions