From a9571b5d8ecc2db8f2d0808eb444bab4baf348c3 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Mon, 22 Dec 2014 10:25:58 +1100 Subject: [PATCH] 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 --- neutron/plugins/midonet/midonet_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.45.2