Revision 723d068c mininet/topo.py
mininet/topo.py | ||
---|---|---|
11 | 11 |
setup for testing, and can even be emulated with the Mininet package. |
12 | 12 |
''' |
13 | 13 |
|
14 |
from networkx import Graph |
|
14 |
from networkx.classes.graph import Graph
|
|
15 | 15 |
|
16 | 16 |
|
17 | 17 |
class NodeID(object): |
... | ... | |
87 | 87 |
|
88 | 88 |
class Topo(object): |
89 | 89 |
'''Data center network representation for structured multi-trees.''' |
90 |
|
|
90 | 91 |
def __init__(self): |
91 | 92 |
'''Create Topo object. |
92 | 93 |
|
... | ... | |
182 | 183 |
|
183 | 184 |
@return dpids list of dpids |
184 | 185 |
''' |
186 |
|
|
185 | 187 |
def is_switch(n): |
186 | 188 |
'''Returns true if node is a switch.''' |
187 | 189 |
return self.node_info[n].is_switch |
... | ... | |
196 | 198 |
|
197 | 199 |
@return dpids list of dpids |
198 | 200 |
''' |
201 |
|
|
199 | 202 |
def is_host(n): |
200 | 203 |
'''Returns true if node is a host.''' |
201 | 204 |
return not self.node_info[n].is_switch |
... | ... | |
391 | 394 |
self._add_edge(s, s + 1, Edge()) |
392 | 395 |
|
393 | 396 |
if enable_all: |
394 |
self.enable_all() |
|
397 |
self.enable_all() |
Also available in: Unified diff