cinder hacking checks don't cover logging format string arg count

Bug #1415241 reported by Duncan Thomas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Derrick Wippler

Bug Description

For example:

LOG.debug("Volume %s caught fire and is at %d degrees C and climbing", (v[name], v[temp]))

The above is easy to code by accident, and the error is trivially recognisable by static analysis (this is done for you by python for %), so hacking should look for it.

A good candidate for the global hacking checks, but a cinder local version is a good start

tags: added: low-hanging-fruit
tags: added: hacking
tags: added: hacking-checks
removed: hacking
Changed in cinder:
assignee: nobody → Scott DAngelo (scott-dangelo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
assignee: Scott DAngelo (scott-dangelo) → Derrick Wippler (thrawn01)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/220246
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=b7fc72c688ab0eaeb4a85a9af3a26428a94854c5
Submitter: Jenkins
Branch: master

commit b7fc72c688ab0eaeb4a85a9af3a26428a94854c5
Author: Derrick J. Wippler <email address hidden>
Date: Thu Sep 3 12:07:19 2015 -0500

    Hacking log format arg check

    Added hacking check for log lines that accidently pass a tuple as the
    second argument when providing format arguments.

    Change-Id: Ifba23948f9fb49e9f6a1ee7e743aba0cd864c827
    Closes-Bug: 1415241

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