quantumclient.common.serializer.XMLDeserializer tries to access non existing attributes of xml node

Bug #1132850 reported by Tatyanka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Medium
Tatyanka

Bug Description

During develop of unit test for serializer I was faced with next situation:
find_first_child_named method of serializer.XMLDeserializer tries to access "parentNodes" attribute of "node" object which is supposed to be of type xml.etree.ElementTree.Element which in turn doesn't have such attribute. (https://github.com/openstack/python-quantumclient/blob/master/quantumclient/common/serializer.py#L324)

Here is the trace, obtained by calling find_first_child_named method:
Error
_StringException: Traceback (most recent call last):
  File "/home/repos/python-quantumclient/quantumclient/tests/unit/test_serializer.py", line 373, in test_find_first_child_named
    actual = deserializer.find_first_child_named(document, 'child1')
  File "/home/repos/python-quantumclient/quantumclient/common/serializer.py", line 326, in find_first_child_named
    for node in parent.childNodes:
AttributeError: 'Element' object has no attribute 'childNodes'

The same situation for methods:
serializer.XMLDeserializer.extract_text
serializer.XMLDeserializer.find_children_named
also this methods are unused and should therefore be removed. (But need someone to approve this)

Revision history for this message
yong sheng gong (gongysh) wrote :

You can remove these methods on quantum server side too. the serializer codes are copied from server side. please fix server side first and then client side.

Changed in python-quantumclient:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 3.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-quantumclient (master)

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

Changed in python-quantumclient:
assignee: nobody → Tatyana (tatyana-leontovich)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-quantumclient (master)

Reviewed: https://review.openstack.org/23073
Committed: http://github.com/openstack/python-quantumclient/commit/406f1adf45be4e6cc74b9e524c53c8227d34fcd9
Submitter: Jenkins
Branch: master

commit 406f1adf45be4e6cc74b9e524c53c8227d34fcd9
Author: Tatyana Leontovich <email address hidden>
Date: Wed Feb 27 11:28:03 2013 +0200

    quantumclient.common.serializer module cleanup

    Remove unused methods in quantumclient.common.serializer.XMLDeserializer
    that tries to access non existing attributes of xml node:
    * find_first_child_named
    * extract_text
    * find_children_named

    Change-Id: I0aff5933fa75e50748e9d0325d898c2f6836fa58
    Fixes: bug #1132850

Changed in python-quantumclient:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
milestone: 3.0.0 → none
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
milestone: none → 2.3.0-2.3.4
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
status: Fix Committed → Fix Released
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.