translate() -> replace() for Python 3 compatibility

str.translate() works differently in Python 3
This commit is contained in:
Bob Lantz
2018-07-25 19:44:44 -07:00
parent cac884a85e
commit 1a2925923f
+1 -1
View File
@@ -893,7 +893,7 @@ class Switch( Node ):
"Return correctly formatted dpid from dpid or switch name (s1 -> 1)"
if dpid:
# Remove any colons and make sure it's a good hex number
dpid = dpid.translate( None, ':' )
dpid = dpid.replace( ':', '' )
assert len( dpid ) <= self.dpidLen and int( dpid, 16 ) >= 0
else:
# Use hex of the first number in the switch name