Comment 0 for bug 1460033

Revision history for this message
Amrith Kumar (amrith) wrote :

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 doesn't always 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.