Cisco: logging incorrectly called with (fmt, arg) tuple

Bug #1404785 reported by Angus Lees
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Angus Lees

Bug Description

cisco.db.n1kv_db_v2._validate_segment_range_uniqueness() includes these
lines:

   msg = (_("NetworkProfile name %s already exists"),
          net_p["name"])
   LOG.error(msg)
   raise n_exc.InvalidInput(error_message=msg)

As written, msg is a tuple, and the various logging lines below print
the tuple members without properly expanding the format string as
intended.

The format in msg should have been expanded using % - as was
presumably the intention. There are few other examples of this
elsewhere in this file.

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

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

Changed in neutron:
assignee: nobody → Angus Lees (gus)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/143353
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=96f40c2c80eee96dc9475d17a7248eeb78ccc383
Submitter: Jenkins
Branch: master

commit 96f40c2c80eee96dc9475d17a7248eeb78ccc383
Author: Angus Lees <email address hidden>
Date: Mon Dec 22 15:11:07 2014 +1100

    Cisco: logging incorrectly called with (fmt, arg) tuple

    cisco.db.n1kv_db_v2._validate_segment_range_uniqueness() includes these
    lines:

       msg = (_("NetworkProfile name %s already exists"),
              net_p["name"])
       LOG.error(msg)
       raise n_exc.InvalidInput(error_message=msg)

    As written, msg is a tuple, and the various logging lines below print
    the tuple members without properly expanding the format string as
    intended.

    The format in msg should have been expanded using % - as was presumably
    the intention. This change fixes this and a similar example elsewhere
    in this file.

    Change-Id: I993245a18ff3db5d5700fb1298ffc958d5827736
    Closes-Bug: #1404785

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.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.