[Nailgun] '{ }' symbols not properly processed for plugin attributes values

Bug #1576197 reported by Andriy Popovych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Andriy Popovych

Bug Description

Steps to reproduce:

1. Install some plugin with text field or text area as types for plugin attributes.
2. Create env and enable plugin.
3. Input '{' or '}' in plugin text field or text are.

Expected result:

Symbols properly stored.

Actual result:

Exception raised:

Traceback (most recent call last):
  File "/sources/fuel-web/nailgun/nailgun/api/v1/handlers/base.py", line 285, in content_json
    resp = func(cls, *args, **kwargs)
  File "/sources/fuel-web/nailgun/nailgun/api/v1/handlers/cluster.py", line 228, in PATCH
    cluster, all_plugins_versions=True)
  File "/sources/fuel-web/nailgun/nailgun/objects/cluster.py", line 381, in get_editable_attributes
    return cls.get_attributes(instance, all_plugins_versions)['editable']
  File "/sources/fuel-web/nailgun/nailgun/objects/cluster.py", line 367, in get_attributes
    keywords={'generator': AttributesGenerator.evaluate}
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 161, in traverse
    value, formatter, formatter_context, keywords
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 161, in traverse
    value, formatter, formatter_context, keywords
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 161, in traverse
    value, formatter, formatter_context, keywords
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 174, in traverse
    for i in data
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 174, in <genexpr>
    for i in data
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 161, in traverse
    value, formatter, formatter_context, keywords
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 161, in traverse
    value, formatter, formatter_context, keywords
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 169, in traverse
    return formatter(data, formatter_context)
  File "/sources/fuel-web/nailgun/nailgun/utils/__init__.py", line 97, in text_format
    raise ValueError("Cannot format {0}: {1}".format(data, e))
ValueError: Cannot format {}: tuple index out of range

Illia Polliul (ipolliul)
Changed in fuel:
status: New → Confirmed
Changed in fuel:
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/312986

Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Andriy Popovych (popovych-andrey)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/312986
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=a4b427fca476da253062167671db56ce3f1ee4da
Submitter: Jenkins
Branch: master

commit a4b427fca476da253062167671db56ce3f1ee4da
Author: Andriy Popovych <email address hidden>
Date: Thu May 5 17:13:17 2016 +0300

    Use text_format_safe instead of text_format

    Use text_format_safe for traversing plugin attributes

    Change-Id: Ib21a7386fe7cea982c98cfeaaa26040463f72b9d
    Closes-Bug: #1576197

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/412383

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/mitaka)

Reviewed: https://review.openstack.org/412383
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=7a61f27d7fca0a7579c65d809537deadce878f0d
Submitter: Jenkins
Branch: stable/mitaka

commit 7a61f27d7fca0a7579c65d809537deadce878f0d
Author: Andriy Popovych <email address hidden>
Date: Thu May 5 17:13:17 2016 +0300

    Use text_format_safe instead of text_format

    Use text_format_safe for traversing plugin attributes

    Change-Id: Ib21a7386fe7cea982c98cfeaaa26040463f72b9d
    Closes-Bug: #1576197
    Closes-Bug: #1614401
    (cherry picked from commit a4b427fca476da253062167671db56ce3f1ee4da)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/8.0)

Fix proposed to branch: stable/8.0
Review: https://review.openstack.org/448577

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/8.0)

Change abandoned by Fuel DevOps Robot (<email address hidden>) on branch: stable/8.0
Review: https://review.openstack.org/448577
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Alexey Stupnikov (<email address hidden>) on branch: stable/8.0
Review: https://review.openstack.org/448577

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.