Can not translate special char "&" in XML function create_volume_metadata volumes_client.py

Bug #1268513 reported by DongHuai Ren
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Ryan McNair
tempest
Fix Released
Undecided
Ryan McNair

Bug Description

1. I add special char like ""!@#$%^&*" in volume "metadata = {"key1": "value1",
                    : "!@#$%^&*"} .Then try to insert it into volume.
2. I test it successfully in volumes_client.create_volume_metadata Json function.
3. When I test it in XML function, it report error like below

Traceback (most recent call last):
  File "/tempest/tempest/api/volume/test_volume_metadata.py", line 130, in test_create_volume_metadata_specialchart_blank
    metadata)
  File "/tempest/tempest/services/volume/xml/volumes_client.py", line 381, in create_volume_metadata
    self.headers)
  File "/tempest/tempest/common/rest_client.py", line 302, in post
    return self.request('POST', url, headers, body)
  File "/tempest/tempest/common/rest_client.py", line 436, in request
    resp, resp_body)
  File "/tempest/tempest/common/rest_client.py", line 530, in _error_checker
    raise exceptions.ServerFault(message)
ServerFault: Got server fault
Details: The server has either erred or is incapable of performing the requested operation.

4. After our investigation, we find when we remove special char "&" , it will be ok. So I think in XML function, it can not translate these special char to correct format.

I also run it in tempest, it also run same error

FAIL: tempest.api.volume.test_volume_metadata.VolumeMetadataTestXML.test_create_volume_metadata_specialchart_blank[gate

2014-01-13 11:13:15.079 | Traceback (most recent call last):
2014-01-13 11:13:15.079 | File "tempest/api/volume/test_volume_metadata.py", line 130, in test_create_volume_metadata_specialchart_blank
2014-01-13 11:13:15.079 | metadata)
2014-01-13 11:13:15.079 | File "tempest/services/volume/xml/volumes_client.py", line 380, in create_volume_metadata
2014-01-13 11:13:15.079 | self.headers)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 302, in post
2014-01-13 11:13:15.080 | return self.request('POST', url, headers, body)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 436, in request
2014-01-13 11:13:15.080 | resp, resp_body)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 530, in _error_checker
2014-01-13 11:13:15.080 | raise exceptions.ServerFault(message)
2014-01-13 11:13:15.080 | ServerFault: Got server fault
2014-01-13 11:13:15.080 | Details: The server has either erred or is incapable of performing the requested operation

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks for your bug report. It looks like a bug not in qtdeclarative, but in some other package (openstack?) instead. Please reassign it as appropriate.

Changed in qtdeclarative-opensource-src (Ubuntu):
status: New → Incomplete
no longer affects: qtdeclarative-opensource-src (Ubuntu)
Revision history for this message
DongHuai Ren (rendh) wrote :

I also run it in tempest, it also run same error

FAIL: tempest.api.volume.test_volume_metadata.VolumeMetadataTestXML.test_create_volume_metadata_specialchart_blank[gate

2014-01-13 11:13:15.079 | Traceback (most recent call last):
2014-01-13 11:13:15.079 | File "tempest/api/volume/test_volume_metadata.py", line 130, in test_create_volume_metadata_specialchart_blank
2014-01-13 11:13:15.079 | metadata)
2014-01-13 11:13:15.079 | File "tempest/services/volume/xml/volumes_client.py", line 380, in create_volume_metadata
2014-01-13 11:13:15.079 | self.headers)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 302, in post
2014-01-13 11:13:15.080 | return self.request('POST', url, headers, body)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 436, in request
2014-01-13 11:13:15.080 | resp, resp_body)
2014-01-13 11:13:15.080 | File "tempest/common/rest_client.py", line 530, in _error_checker
2014-01-13 11:13:15.080 | raise exceptions.ServerFault(message)
2014-01-13 11:13:15.080 | ServerFault: Got server fault
2014-01-13 11:13:15.080 | Details: The server has either erred or is incapable of performing the requested operation

DongHuai Ren (rendh)
description: updated
Ryan McNair (rdmcnair)
Changed in cinder:
assignee: nobody → Ryan McNair (rdmcnair)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Ryan McNair (rdmcnair)
Changed in tempest:
status: New → In Progress
assignee: nobody → Ryan McNair (rdmcnair)
Revision history for this message
Ryan McNair (rdmcnair) wrote :

Not sure why this commit isn't being referenced here automatically but https://review.openstack.org/#/c/69932/ is the proposed fix to Tempest

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/69932
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=9acfcf731cf7b7e67b8d8707478df69b301b0fff
Submitter: Jenkins
Branch: master

commit 9acfcf731cf7b7e67b8d8707478df69b301b0fff
Author: Ryan McNair <email address hidden>
Date: Mon Jan 27 21:06:48 2014 +0000

    Add support for special char in volume metadata

    Using special characters such as "&" in volume metadata caused
    a server error when using the XML volume client because these
    chars were not being escaped.

    Closes-Bug: #1268513
    Change-Id: I03d5f4d1f7480f8a3c405f77143835f1a9be7ec4

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Automatically unassigning due to inactivity.

Changed in cinder:
assignee: Ryan McNair (rdmcnair) → nobody
status: In Progress → Triaged
Revision history for this message
Ryan McNair (rdmcnair) wrote :

This was actually fixed in Cinder by https://review.openstack.org/#/c/69933/ a ways back, not sure why it didn't close. Will close it now.

Changed in cinder:
status: Triaged → Fix Released
assignee: nobody → Ryan McNair (rdmcnair)
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.