]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix typo'd format parameter in midonet_lib.py
authorAngus Lees <gus@inodes.org>
Sun, 21 Dec 2014 23:25:58 +0000 (10:25 +1100)
committerAngus Lees <gus@inodes.org>
Sun, 21 Dec 2014 23:25:58 +0000 (10:25 +1100)
In add_static_nat(...):

        LOG.debug("MidoClient.add_static_nat called: "
                  "tenant_id=%(tenant_id)s, chain_name=%(chain_name)s, "
                  "from_ip=%(from_ip)s, to_ip=%(to_ip)s, "
                  "port_id=%(port_id)s, nat_type=%(nat_type)s",
                  {'tenant_id': tenant_id, 'chain_name': chain_name,
                   'from_ip': from_ip, 'to_ip': to_ip,
                   'portid': port_id, 'nat_type': nat_type})

Note port_id vs portid.  This line of code raises a KeyError if debug
logging is enabled.

(Found via pylint)

Change-Id: I4d76255a559489f2f0e074b4489cfa5f33f1dddf
Closes-Bug: #1404755

neutron/plugins/midonet/midonet_lib.py

index c4ed1cf143dc1caa6bce858490c3bed31a254390..863a858d1f1a575d3b94cdb2a8f510dafe9d5df9 100644 (file)
@@ -518,7 +518,7 @@ class MidoClient:
                   "port_id=%(port_id)s, nat_type=%(nat_type)s",
                   {'tenant_id': tenant_id, 'chain_name': chain_name,
                    'from_ip': from_ip, 'to_ip': to_ip,
-                   'portid': port_id, 'nat_type': nat_type})
+                   'port_id': port_id, 'nat_type': nat_type})
         if nat_type not in ['dnat', 'snat']:
             raise ValueError(_("Invalid NAT type passed in %s") % nat_type)