Bug #4331

Sunstone wizards break certain template elements with char escaping

Added by Boris Parak over 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:02/13/2016
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Sunstone
Target version:Release 5.0
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.14

Description

Sunstone wizards break certain template elements with char escaping, for example:

SCHED_REQUIREMENTS="(HYPERVISOR=\"kvm\") && (CLUSTER=\"mycluster\")"

will be escaped as

SCHED_REQUIREMENTS="(HYPERVISOR=\"kvm\") & (CLUSTER=\"mycluster\")"

and break the scheduler:

Error in SCHED_REQUIREMENTS: 'CLUSTER_ID = 1 & !(PUBLIC_CLOUD = YES) & ( (HYPERVISOR="kvm") &amp;amp; (CLUSTER="mycluster") )', error: syntax error, unexpected STRING, expecting '!' or '=' or '>' or '<' at    
line 1, columns 70:73

Something similar happens in CONTEXT=[USER_DATA="..."].

user_data.patch Magnifier (2.59 KB) Boris Parak, 02/16/2016 06:10 PM


Related issues

Related to Feature #4106: Implement consistent treatment of double quotes in inputs Closed 10/28/2015

History

#1 Updated by Ruben S. Montero over 5 years ago

  • Target version set to Release 5.0

#2 Updated by Boris Parak over 5 years ago

If you could point me to the code (in JS, I presume) doing this escaping, I would be really grateful. I need to come up with a quick hack to fix this on our production instance.

Thanks!

#3 Updated by Boris Parak over 5 years ago

If anyone is interested, here is our temporary solution for `SCHED_REQUIREMENTS` and `CONTEXT/USER_DATA`.

1.) `SCHED_REQUIREMENTS`

Enabling the `Scheduling` tab for ordinary users (the `user` view) moved the `SCHED_REQUIREMENTS` attribute to the proper input box (originally it appeared in `Custom` on the `Other` tab). This prevented further unwanted escaping.

2.) `CONTEXT/USER_DATA`

Creating a custom input area on the `Context` tab moved the `CONTEXT/USER_DATA` attribute out of `Custom` on the `Other` tab. This prevented further unwanted escaping.

The first one can be achieved by configuration only, we can provide a simple patch for the second one.

#4 Updated by Boris Parak over 5 years ago

Attaching the USER_DATA patch. If there is interest, I can open a pull request against the master branch on GH.

#5 Updated by Daniel Molina over 5 years ago

  • Related to Feature #4106: Implement consistent treatment of double quotes in inputs added

#6 Updated by Daniel Molina over 5 years ago

  • Status changed from Pending to New
  • Priority changed from Normal to High

#7 Updated by Carlos Martín about 5 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Fixed in master (feature #4106)

Also available in: Atom PDF