From: Angus Lees Date: Sun, 21 Dec 2014 23:25:58 +0000 (+1100) Subject: Fix typo'd format parameter in midonet_lib.py X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a9571b5d8ecc2db8f2d0808eb444bab4baf348c3;p=openstack-build%2Fneutron-build.git Fix typo'd format parameter in midonet_lib.py 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 --- diff --git a/neutron/plugins/midonet/midonet_lib.py b/neutron/plugins/midonet/midonet_lib.py index c4ed1cf14..863a858d1 100644 --- a/neutron/plugins/midonet/midonet_lib.py +++ b/neutron/plugins/midonet/midonet_lib.py @@ -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)