config: topologies: slight code refactor
authorNilay Vaish <nilay@cs.wisc.edu>
Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Mon, 24 Feb 2014 01:16:15 +0000 (19:16 -0600)
configs/topologies/Cluster.py

index 5f41edd0a022deed7daa5c1706c3954c1ad03533..b146d8675a620043cefbd0f4a82c44798c89a3a9 100644 (file)
@@ -86,10 +86,15 @@ class Cluster(BaseTopology):
                 node.makeTopology(options, network, IntLink, ExtLink, Router)
 
                 # connect this cluster to the router
-                link = IntLink(link_id=self.num_int_links(), node_a=self.router, node_b=node.router)
+                link = IntLink(link_id=self.num_int_links(), node_a=self.router,
+                        node_b=node.router)
+
                 if node.extBW:
                     link.bandwidth_factor = node.extBW
-                elif self.intBW: # if there is an interanl b/w for this node and no ext b/w to override
+
+                # if there is an interanl b/w for this node
+                # and no ext b/w to override
+                elif self.intBW:
                     link.bandwidth_factor = self.intBW
 
                 if node.extLatency:
@@ -99,8 +104,11 @@ class Cluster(BaseTopology):
 
                 network.int_links.append(link)
             else:
-                # node is just a controller connect it to the router via a ext_link
-                link = ExtLink(link_id=self.num_ext_links(), ext_node=node, int_node=self.router)
+                # node is just a controller,
+                # connect it to the router via a ext_link
+                link = ExtLink(link_id=self.num_ext_links(), ext_node=node,
+                        int_node=self.router)
+
                 if self.intBW:
                     link.bandwidth_factor = self.intBW
                 if self.intLatency: