Bug #3108
closedbreak rules generation using quotes in a "File content" in a directive like "Enforce a file content"
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.
Updated by Nicolas CHARLES almost 12 years ago
- Category set to Web - Config management
- Status changed from New to In progress
- Assignee set to Nicolas CHARLES
- Target version set to 2.6.0~beta1
This is being handled in #2947 and subtickets
This will be corrected in 2.6
Updated by Nicolas PERRON over 11 years ago
- Target version changed from 2.6.0~beta1 to 2.6.0~rc1
Updated by Jonathan CLARKE over 11 years ago
- Target version changed from 2.6.0~rc1 to 2.6.0
Updated by Matthieu CERDA over 11 years ago
- Status changed from In progress to Rejected
- Assignee changed from Nicolas CHARLES to Matthieu CERDA
- Priority changed from N/A to 1 (highest)
- % Done changed from 0 to 100
This issue has been successfully corrected and tested in the 2.6.0~rc1 of Rudder.
Rejecting, but this is a corrected issue actually :)