← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1617749] [NEW] Angular template cache breaks when the template contains backslashes

 

Public bug reported:

The angular_escapes filter [1] currently does not handle backslashes
('\'), therefore templates containing this character are broken (or have
their behaviour modified) when they are cached.

We faced this issue when deploying the LBaaSv2 dashboard [2], which uses
ng-pattern="/^\d+$/" in multiple fields. This is transformed to ng-
pattern=\"/^\d+$/\" when the pattern is cached (see [3]), which results
in validator failures that block the usage of the LBaaSv2 dashboard.

Although the Horizon code base employs ng-pattern="/^[0-9]+$/" instead
when a numeric validator is desired, we feel that not escaping the
backslash is a dangerous behaviour which might cause other issues in the
future.

We will send in a few minutes a patch to gerrit proposing a fix for this
issue.

--

Expected behaviour: It should be possible to create a new load balancer
via the dashboard when deploying Horizon together with the LBaaSv2
dashboard.

Actual behaviour: The validator fails on the "port" fields, which are
mandatory to create a new load balancer. This blocks the creation of new
load balancers through the dashboard.

Steps to reproduce:
* Deploy the environment
* Go to Project > Networks > Load Balancers
* Click on "Create Load Balancer"
* Try to fill a Port in the "Listener Details" tab

Environment:
* OpenStack-Ansible, master branch
* Multi-node deploy
* "neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2" included in "neutron_plugin_base"


--
References

[1]
https://github.com/openstack/horizon/blob/107488f2f53f55ce2b727e52b5496db47ffc21ce/horizon/templatetags/angular.py#L57

[2] https://github.com/openstack/neutron-lbaas-
dashboard/blob/c68b80b0bb9f89acd46da717b360b429efade43a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html#L73

[3] http://ix.io/1hqG

** Affects: horizon
     Importance: Undecided
     Assignee: Paulo Matias (paulo-matias)
         Status: In Progress

** Changed in: horizon
     Assignee: (unassigned) => Paulo Matias (paulo-matias)

** Changed in: horizon
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1617749

Title:
  Angular template cache breaks when the template contains backslashes

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  The angular_escapes filter [1] currently does not handle backslashes
  ('\'), therefore templates containing this character are broken (or
  have their behaviour modified) when they are cached.

  We faced this issue when deploying the LBaaSv2 dashboard [2], which
  uses ng-pattern="/^\d+$/" in multiple fields. This is transformed to
  ng-pattern=\"/^\d+$/\" when the pattern is cached (see [3]), which
  results in validator failures that block the usage of the LBaaSv2
  dashboard.

  Although the Horizon code base employs ng-pattern="/^[0-9]+$/" instead
  when a numeric validator is desired, we feel that not escaping the
  backslash is a dangerous behaviour which might cause other issues in
  the future.

  We will send in a few minutes a patch to gerrit proposing a fix for
  this issue.

  --

  Expected behaviour: It should be possible to create a new load
  balancer via the dashboard when deploying Horizon together with the
  LBaaSv2 dashboard.

  Actual behaviour: The validator fails on the "port" fields, which are
  mandatory to create a new load balancer. This blocks the creation of
  new load balancers through the dashboard.

  Steps to reproduce:
  * Deploy the environment
  * Go to Project > Networks > Load Balancers
  * Click on "Create Load Balancer"
  * Try to fill a Port in the "Listener Details" tab

  Environment:
  * OpenStack-Ansible, master branch
  * Multi-node deploy
  * "neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2" included in "neutron_plugin_base"

  
  --
  References

  [1]
  https://github.com/openstack/horizon/blob/107488f2f53f55ce2b727e52b5496db47ffc21ce/horizon/templatetags/angular.py#L57

  [2] https://github.com/openstack/neutron-lbaas-
  dashboard/blob/c68b80b0bb9f89acd46da717b360b429efade43a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.html#L73

  [3] http://ix.io/1hqG

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1617749/+subscriptions


Follow ups