Project

General

Profile

Actions

Bug #3108

closed

break rules generation using quotes in a "File content" in a directive like "Enforce a file content"

Added by Fabrice FLORE-THÉBAULT over 11 years ago. Updated about 11 years ago.

Status:
Rejected
Priority:
1
Assignee:
Matthieu CERDA
Category:
Web - Config management
Target version:
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.


Related issues 2 (0 open2 closed)

Related to Rudder - User story #2947: A special textarea-type field should exist for the Techniques that automatically escapes some charactersReleasedMatthieu CERDA2013-02-18Actions
Related to Rudder - User story #1848: Escape special characters like ' " or ! in directive valuesRejected2011-09-26Actions
Actions

Also available in: Atom PDF