Canonicalize dpid by removing colons and padding with zeros

closes #268
This commit is contained in:
Bob Lantz
2014-01-29 16:54:25 -08:00
parent 34bb64eddd
commit 29988c8b1d
+2 -1
View File
@@ -756,7 +756,8 @@ class Switch( Node ):
opts: additional switch options
listenPort: port to listen on for dpctl connections"""
Node.__init__( self, name, **params )
self.dpid = dpid if dpid else self.defaultDpid()
self.dpid = ( ( '0' * self.dpidLen + dpid.translate( None, ':' ) )
[ -self.dpidLen: ] if dpid else self.defaultDpid() )
self.opts = opts
self.listenPort = listenPort
if not self.inNamespace: