Using substitution for Python String

This patch using String substitution instead of String concatenation.

Change-Id: I1faabeb1943449ae60232e08a842652c86793a45
This commit is contained in:
Dongcan Ye
2015-12-06 12:56:17 +08:00
parent 798c8d780f
commit 3141489e9e

View File

@@ -99,10 +99,11 @@ class VifPort(object):
self.switch = switch
def __str__(self):
return ("iface-id=" + self.vif_id + ", vif_mac=" +
self.vif_mac + ", port_name=" + self.port_name +
", ofport=" + str(self.ofport) + ", bridge_name=" +
self.switch.br_name)
return ("iface-id=%s, vif_mac=%s, port_name=%s, ofport=%s, "
"bridge_name=%s") % (
self.vif_id, self.vif_mac,
self.port_name, self.ofport,
self.switch.br_name)
class BaseOVS(object):