Comment 32 for bug 1445412

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/kilo)

Reviewed: https://review.openstack.org/176450
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=58af5e101d30027549bda9308536e9f45ed0bfef
Submitter: Jenkins
Branch: stable/kilo

commit 58af5e101d30027549bda9308536e9f45ed0bfef
Author: Kevin Benton <email address hidden>
Date: Fri Apr 17 03:53:45 2015 -0700

    Defer creation of router JSON in get_routers RPC

    The get_routers method in the l3 RPC code has a log.debug
    statement that formats all of the router data as indented
    JSON. This method can be expensive if there are hundreds
    of routers being synced and it happens even if debugging
    is disabled since the function call result is the parameter
    to the debug statement.

    This patch adds and leverages a small helper class that takes a
    callable and its args and defers calling it until the __str__ method
    is called on it when it's actually trying to be rendered to a string.

    Change-Id: I2bfceb286ce30f2a3595381b62bdc6dd71ed8483
    Partial-Bug: #1445412
    (cherry picked from commit 649599457e29b58ad0aec9ace990e0a2b59b05d0)