Missing JSON blob causes exception in API

Bug #1342306 reported by Steve McLellan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
High
Steve McLellan

Bug Description

After the change to add supplier information, pre-existing packages (that don't have entries for supplier information) cause a TypeError:

Trace ends with:
  ...
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/types.py", line 838, in process
    return process_value(value, dialect)
  File "/opt/stack/murano/murano/db/models.py", line 104, in process_result_value
    return anyjson.deserialize(value)
  File "/usr/lib/python2.7/dist-packages/anyjson/__init__.py", line 135, in loads
    return implementation.loads(value)
  File "/usr/lib/python2.7/dist-packages/anyjson/__init__.py", line 98, in loads
    return self._filedecode(StringIO(s))
TypeError: must be string or buffer, not None

Patching db/models.py not to try to deserialize None as JSON fixes the issue.

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

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

Changed in murano:
assignee: nobody → Steve McLellan (sjmc7)
status: New → In Progress
Changed in murano:
importance: Undecided → High
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/107167
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=3509b530d0ef96f5844497ef946e3e25072baf56
Submitter: Jenkins
Branch: master

commit 3509b530d0ef96f5844497ef946e3e25072baf56
Author: Steve McLellan <email address hidden>
Date: Tue Jul 15 15:33:26 2014 -0500

    Handle null JSON blobs

    The JSON deserializer doesn't handle null values properly; it raises
    a TypeError because it expects a string or buffer. This became apparent
    after the supplier info update which added columns that would be null
    for existing packages. Patch returns None from the JSON deserializer
    in that case, and also refactors unittest base classes.

    Change-Id: I6f31500d2dd1aaaf6a1fd26c1901666072d79776
    Closes-Bug: #1342306

Changed in murano:
status: In Progress → Fix Committed
ruhe (ruhe)
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: juno-2 → 2014.2
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.