]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Cisco: logging incorrectly called with (fmt, arg) tuple
authorAngus Lees <gus@inodes.org>
Mon, 22 Dec 2014 04:11:07 +0000 (15:11 +1100)
committerAngus Lees <gus@inodes.org>
Mon, 22 Dec 2014 04:11:07 +0000 (15:11 +1100)
commit96f40c2c80eee96dc9475d17a7248eeb78ccc383
treea680c886661e07cb8f7158937f5a980fafdebc63
parentfffc6e4712328574a8fe42d7b7520c0dace2b6b7
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
neutron/plugins/cisco/db/n1kv_db_v2.py