trove API schema matching code has dead debug message

Bug #1460033 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Amrith Kumar

Bug Description

A very useful debug message in the bowels of common/wsgi.py which shows how the API schema matching is working is broken.

    @classmethod
    def get_schema(cls, action, body):
        LOG.debug("Getting schema for %s:%s" %
                  (cls.__class__.__name__, action))
        if cls.schemas:
            matching_schema = cls.schemas.get(action, {})
            if matching_schema:
                LOG.debug("Found Schema: %s" % matching_schema.get("name",
                                                                   "none"))
            return matching_schema

Since the matching_schema almost always does not have a property called 'name', most often the debug message looks like this:

2015-04-26 03:38:31.354 DEBUG trove.common.wsgi [req-3f321202-74fe-45e6-997c-8cd956458ae5 92edfc0f5aa4461db0bf73fb85082de4 70195ed77e594c63b33c5403f2e2885c] Found Schema: none from (pid=69728) get_schema /opt/stack/trove/trove/common/wsgi.py:378

This is quite unhelpful most of the time, and ends up being misleading.

Amrith Kumar (amrith)
Changed in trove:
assignee: nobody → Amrith (amrith)
importance: Undecided → Medium
description: updated
Changed in trove:
status: New → In Progress
Changed in trove:
milestone: none → liberty-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/186732
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=342c52c6e9f11bc9f54ef1fe3e242e76654ee991
Submitter: Jenkins
Branch: master

commit 342c52c6e9f11bc9f54ef1fe3e242e76654ee991
Author: Amrith Kumar <email address hidden>
Date: Thu May 28 15:27:09 2015 -0400

    Fixes a broken debug message in schema matching

    This rather useful debug tool in the bowels of common/wsgi.py produces
    a misleading message because, most often, the matching_schema has no
    property called 'name'. Fixed it to print the schema in its entirety
    because in most cases one would take the name and go lookup the schema
    anyway.

    The other way around would be to go and change all of apischema.py and
    add a name property. This seemed to be the less intrusive and
    disruptive change.

    Change-Id: I4075bc911d2cc07cb6e7d98ffcff96441f7b3416
    Closes-Bug: #1460033

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: liberty-1 → 4.0.0
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.