diff --git a/mininet/topo.py b/mininet/topo.py index af3eac5f55707d83217d85b5101ed27134462fb0..efc16aa4cf041aa9329c3febd77022e366737afc 100644 --- a/mininet/topo.py +++ b/mininet/topo.py @@ -23,7 +23,8 @@ def __init__( self ): def add_node( self, node, attr_dict=None, **attrs): """Add node to graph attr_dict: attribute dict (optional) - attrs: more attributes (optional)""" + attrs: more attributes (optional) + warning: updates attr_dict with attrs""" attr_dict = {} if attr_dict is None else attr_dict attr_dict.update( attrs ) self.node[ node ] = attr_dict @@ -31,7 +32,9 @@ def add_node( self, node, attr_dict=None, **attrs): def add_edge( self, src, dst, key=None, attr_dict=None, **attrs ): """Add edge to graph key: optional key - attr_dict: optional attribute dict""" + attr_dict: optional attribute dict + attrs: more attributes + warning: udpates attr_dict with attrs""" attr_dict = {} if attr_dict is None else attr_dict attr_dict.update( attrs ) self.node.setdefault( src, {} ) @@ -151,6 +154,7 @@ def addLink( self, node1, node2, port1=None, port2=None, if not opts and self.lopts: opts = self.lopts port1, port2 = self.addPort( node1, node2, port1, port2 ) + opts = dict( opts ) opts.update( node1=node1, node2=node2, port1=port1, port2=port2 ) self.g.add_edge(node1, node2, key, opts ) return key