Merge "Fix pep8 violations in MininetHandler"
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 17 Mar 2015 03:52:39 +0000 (03:52 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 17 Mar 2015 03:52:39 +0000 (03:52 +0000)
test/tools/Robot_Tool/libraries/MininetHandler.py

index 0960491df5d7017cfdce235d81f5fc030d04256b..95f33db2de8c9385155dc493559f0ddcb79c7f5f 100644 (file)
@@ -5,41 +5,42 @@ Updated: 2013-11-18
 """
 from mininet.net import Mininet
 
+
 class MininetHandler(object):
     '''
     MininetHandler class will provide all operations about Mininet, such as config controller_ip, start or stop net.
     '''
-    def __init__(self,controller_ip='127.0.0.1'):
+    def __init__(self, controller_ip='127.0.0.1'):
         self.controller_ip = controller_ip
-        self.net=None
+        self.net = None
 
-    def set_controller_ip(self,controller_ip):
+    def set_controller_ip(self, controller_ip):
         self.controller_ip = controller_ip
 
     def config_net(self):
-        net = Mininet(switch=OVSKernelSwitch,controller=RemoteController)
+        net = Mininet(switch=OVSKernelSwitch, controller=RemoteController)  # noqa
 
         print '*** Adding controller'
-        net.addController('c0',ip=self.controller_ip)
+        net.addController('c0', ip=self.controller_ip)
 
         print '*** Adding hosts'
-        h1 = net.addHost( 'h1', mac='00:00:00:00:00:01')
-        h2 = net.addHost( 'h2', mac='00:00:00:00:00:02')
-        h3 = net.addHost( 'h3', mac='00:00:00:00:00:03')
-        h4 = net.addHost( 'h4', mac='00:00:00:00:00:04')
+        h1 = net.addHost('h1', mac='00:00:00:00:00:01')
+        h2 = net.addHost('h2', mac='00:00:00:00:00:02')
+        h3 = net.addHost('h3', mac='00:00:00:00:00:03')
+        h4 = net.addHost('h4', mac='00:00:00:00:00:04')
 
         print '*** Adding switch'
-        s1 = net.addSwitch( 's1' )
-        s2 = net.addSwitch( 's2' )
-        s3 = net.addSwitch( 's3' )
+        s1 = net.addSwitch('s1')
+        s2 = net.addSwitch('s2')
+        s3 = net.addSwitch('s3')
 
         print '*** Creating links'
-        net.addLink(h1,s2)
-        net.addLink(h2,s2)
-        net.addLink(h3,s3)
-        net.addLink(h4,s3)
-        net.addLink(s1,s2)
-        net.addLink(s1,s3)
+        net.addLink(h1, s2)
+        net.addLink(h2, s2)
+        net.addLink(h3, s3)
+        net.addLink(h4, s3)
+        net.addLink(s1, s2)
+        net.addLink(s1, s3)
 
         self.net = net