From 6cb8d01affa6718cc4b426ff1235d4f8f05aa5ca Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Mon, 16 Mar 2015 00:02:10 -0400 Subject: [PATCH] Fix pep8 violations in MininetHandler Change-Id: If6d0e6562861be697ad3c2cb7cfd2f8057c5141e Signed-off-by: Thanh Ha --- .../Robot_Tool/libraries/MininetHandler.py | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/test/tools/Robot_Tool/libraries/MininetHandler.py b/test/tools/Robot_Tool/libraries/MininetHandler.py index 0960491df5..95f33db2de 100644 --- a/test/tools/Robot_Tool/libraries/MininetHandler.py +++ b/test/tools/Robot_Tool/libraries/MininetHandler.py @@ -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 -- 2.36.6