OVO vif_details not loading correctly from DB

Bug #1638703 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Kevin Benton

Bug Description

The modify_fields_from_db method for the port binding OVO does not work correctly with 'vif_details'. The json parser falls apart when it encounters the empty details case, which is represented in our DB schema as an empty string ''.

    obj_fields = self._test_class.modify_fields_from_db(db_obj)
  File "neutron/objects/ports.py", line 66, in modify_fields_from_db
    fields['vif_details'] = jsonutils.loads(fields['vif_details'])
  File "/opt/stack/neutron/.tox/py27/local/lib/python2.7/site-packages/oslo_serialization/jsonutils.py", line 241, in loads
    return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Ran 2 (-269) tests in 1.157s (-41.866s)

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/392960
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=660946a921ce41b196533fe49d0df4e5a479eea0
Submitter: Jenkins
Branch: master

commit 660946a921ce41b196533fe49d0df4e5a479eea0
Author: Kevin Benton <email address hidden>
Date: Wed Nov 2 13:45:10 2016 -0700

    Fix modify_fields_from_db for vif_details empty str

    vif_details is represented as an empty string in our DB schema
    when it's not defined. The 'modify_fields_from_db' method was
    incorrectly attempting to feed this directly into the json decoder.

    Closes-Bug: #1638703
    Change-Id: I7b13fb30de71bb4dce4dbab4ffe430e1d0ef8f3a

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b1

This issue was fixed in the openstack/neutron 10.0.0.0b1 development milestone.

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.