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 almost 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 #1

Updated by Nicolas CHARLES about 11 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

Actions #2

Updated by Nicolas PERRON about 11 years ago

  • Target version changed from 2.6.0~beta1 to 2.6.0~rc1
Actions #3

Updated by Jonathan CLARKE almost 11 years ago

  • Target version changed from 2.6.0~rc1 to 2.6.0
Actions #4

Updated by Matthieu CERDA almost 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
  • % 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 :)

Actions

Also available in: Atom PDF