Reverting core/ and drivers/ directories before change 15514

This reverts commit 23fb21617769f4320de93b5b1805c6ec3ca9b809.

Change-Id: I0c116f8d7195c75c7ef17f296843924d3e2a0961
diff --git a/TestON/drivers/common/cli/dpclidriver.py b/TestON/drivers/common/cli/dpclidriver.py
index 5091d1a..2386c45 100644
--- a/TestON/drivers/common/cli/dpclidriver.py
+++ b/TestON/drivers/common/cli/dpclidriver.py
@@ -1,5 +1,5 @@
 """
-Copyright 2015 Open Networking Foundation ( ONF )
+Copyright 2015 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -38,9 +38,9 @@
 
         self.name = self.options[ 'name' ]
         self.handle = super( DPCliDriver, self ).connect( user_name=self.user_name,
-                                                          ip_address=self.ip_address,
-                                                          port=self.port,
-                                                          pwd=self.pwd )
+                        ip_address=self.ip_address,
+                        port=self.port,
+                        pwd=self.pwd )
 
         if self.handle:
             return self.handle
@@ -148,7 +148,7 @@
         self.handle.sendline( "sudo fping -S " + str( netsrc ) + "." +
                               str( netstrt ) + ".1.1 -f /tmp/ip_table" +
                               str( netdst ) + ".txt" )
-        while True:
+        while 1:
             i = self.handle.expect( [
                                     "reachable",
                                     "unreachable",
@@ -210,3 +210,4 @@
             main.log.exception( "Connection failed to the host" )
             response = main.FALSE
         return response
+
diff --git a/TestON/drivers/common/cli/emulator/flowvisordriver.py b/TestON/drivers/common/cli/emulator/flowvisordriver.py
index 0e53125..e1877ae 100644
--- a/TestON/drivers/common/cli/emulator/flowvisordriver.py
+++ b/TestON/drivers/common/cli/emulator/flowvisordriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Mar-2013
-Copyright 2013 Open Networking Foundation ( ONF )
+Copyright 2013 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -42,7 +42,7 @@
         self.wrapped = sys.modules[ __name__ ]
 
     def connect( self, **connectargs ):
-        # user_name, ip_address, pwd,options ):
+        #,user_name, ip_address, pwd,options ):
         # Here the main is the TestON instance after creating all the log
         # handles.
         for key in connectargs:
@@ -63,7 +63,7 @@
         if self.handle:
             self.execute( cmd='\r', prompt=self.prompt, timeout=10 )
             self.options[ 'path' ] = '/home/openflow/flowvisor/scripts/'
-            # self.handle.logfile = sys.stdout
+            #self.handle.logfile = sys.stdout
             self.execute(
                 cmd='cd ' +
                 self.options[ 'path' ],
@@ -90,9 +90,9 @@
                 self.fvprocess_id,
                 onfail="Failed to start FlowVisor" )
             main.log.info( response )
-            # import time
+            #import time
             # time.sleep( 10 )
-            # response = self.execute( cmd='./start_visualizer.sh & \r',prompt=self.prompt,timeout=10 )
+            #response = self.execute( cmd='./start_visualizer.sh & \r',prompt=self.prompt,timeout=10 )
 
             return main.TRUE
         else:
@@ -192,7 +192,7 @@
 
     def listDevices( self ):
         # self.execute( cmd="clear",prompt=self.prompt,timeout=10 )
-        # self.execute( cmd="./fvctl.sh listDevices ",prompt="passwd:",timeout=10 )
+        #self.execute( cmd="./fvctl.sh listDevices ",prompt="passwd:",timeout=10 )
         # self.execute( cmd="\n",prompt=self.prompt,timeout=10 )
         devices_list = ''
         last_response = re.findall(
diff --git a/TestON/drivers/common/cli/emulator/lincoedriver.py b/TestON/drivers/common/cli/emulator/lincoedriver.py
index f41b6d2..d5e114a 100644
--- a/TestON/drivers/common/cli/emulator/lincoedriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoedriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 """
-Copyright 2014 Open Networking Foundation ( ONF )
+Copyright 2014 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -35,6 +35,7 @@
 
 OCT 20 2014
 """
+
 import pexpect
 import sys
 from drivers.common.cli.emulatordriver import Emulator
@@ -55,6 +56,7 @@
         """
         Create ssh handle for Linc-OE cli
         """
+
         for key in connectargs:
             vars( self )[ key ] = connectargs[ key ]
 
@@ -219,7 +221,7 @@
         """
             Since executing opticalTest.py will give you mininet
             prompt, you would at some point require to get onto
-            console of LincOE ( ( linc@onosTestBench )1> ) to execute
+            console of LincOE ((linc@onosTestBench)1>) to execute
             commands like bring a optical port up or down on a ROADM
             You can attach to console of Linc-OE session by a cmd:
             sudo ~/linc-oe/rel/linc/bin/linc attach
diff --git a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
index 2a85d63..bfa466f 100644
--- a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 """
-Copyright 2016 Open Networking Foundation ( ONF )
+Copyright 2016 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -23,6 +23,7 @@
 
 LincOEMininetDriver is an extension of the mininetclidriver to handle linc oe
 """
+
 import pexpect
 import re
 import sys
@@ -31,8 +32,7 @@
 
 
 class LincOEMininetDriver( MininetCliDriver ):
-
-    def runOpticalMnScript( self, onosDirectory='onos', ctrllerIP=None, topology='opticalTest' ):
+    def runOpticalMnScript( self, onosDirectory = 'onos', ctrllerIP = None, topology = 'opticalTest' ):
         import time
         import types
         """
@@ -41,22 +41,22 @@
                 It runs python script "opticalTest.py" to create the
                 packet layer( mn ) and optical topology
             Optional:
-                name - Name of onos directory. ( ONOS | onos )
+                name - Name of onos directory. (ONOS | onos)
                 topology - Name of optical topology to activate, defaults to opticalTest.py
             Required:
-                ctrllerIP = Controller( s ) IP address
+                ctrllerIP = Controller(s) IP address
             TODO: If no ctrllerIP is provided, a default
                 $OC1 can be accepted
         """
         try:
-            if ctrllerIP is None:
+            if ctrllerIP == None:
                 main.log.error( "You need to specify the IP" )
                 return main.FALSE
             else:
                 controller = ''
                 if isinstance( ctrllerIP, types.ListType ):
                     for i in xrange( len( ctrllerIP ) ):
-                        controller += ctrllerIP[ i ] + ' '
+                        controller += ctrllerIP[i] + ' '
                     main.log.info( "Mininet topology is being loaded with " +
                                    "controllers: " + controller )
                 elif isinstance( ctrllerIP, types.StringType ):
@@ -70,12 +70,12 @@
                 cmd = "sudo -E python {0} {1}".format( topoFile, controller )
                 main.log.info( self.name + ": cmd = " + cmd )
                 self.handle.sendline( cmd )
-                lincStart = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ], timeout=120 )
+                lincStart = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ],timeout=120 )
                 if lincStart == 1:
                     self.handle.sendline( "\x03" )
                     self.handle.sendline( "sudo mn -c" )
                     self.handle.sendline( cmd )
-                    lincStart = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ], timeout=120 )
+                    lincStart = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ],timeout=120 )
                 if lincStart == 1:
                     main.log.error( "OpticalTest.py failed to start." )
                     return main.FALSE
@@ -85,7 +85,7 @@
             main.log.error( self.name + ":     " + self.handle.before )
             return main.FALSE
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
             return main.FALSE
 
@@ -120,7 +120,7 @@
             main.log.error( self.name + ":     " + self.handle.before )
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
         main.log.info( self.name + ": Ping Response: " + response )
         if re.search( ',\s0\%\spacket\sloss', response ):
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index a1b691c..d69fbeb 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -45,7 +45,6 @@
 
 
 class MininetCliDriver( Emulator ):
-
     """
        MininetCliDriver is the basic driver which will handle
        the Mininet functions"""
@@ -126,12 +125,12 @@
     def startNet( self, topoFile='', args='', mnCmd='', timeout=120 ):
         """
         Description:
-            Starts Mininet accepts a topology( .py ) file and/or an optional
+            Starts Mininet accepts a topology(.py) file and/or an optional
             argument, to start the mininet, as a parameter.
             Can also send regular mininet command to load up desired topology.
             Eg. Pass in a string 'mn --topo=tree,3,3' to mnCmd
         Options:
-            topoFile = file path for topology file ( .py )
+            topoFile = file path for topology file (.py)
             args = extra option added when starting the topology from the file
             mnCmd = Mininet command use to start topology
         Returns:
@@ -185,7 +184,7 @@
                         main.log.info(
                             "Starting Mininet from topo file " +
                             topoFile )
-                        cmdString += "-E python " + topoFile + " "
+                        cmdString +=  "-E python " + topoFile + " "
                         if args is None:
                             args = ''
                             # TODO: allow use of args from .topo file?
@@ -435,6 +434,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+
     def pingallHosts( self, hostList, wait=1 ):
         """
             Ping all specified IPv4 hosts
@@ -462,7 +462,7 @@
                 pingList = hostList[ :listIndex ] + \
                     hostList[ ( listIndex + 1 ): ]
 
-                pingResponse += str( str( host ) + " -> " )
+                pingResponse += str(str(host) + " -> ")
 
                 for temp in pingList:
                     # Current host pings all other hosts specified
@@ -471,14 +471,14 @@
                     self.handle.expect( "mininet>", timeout=wait + 1 )
                     response = self.handle.before
                     if re.search( ',\s0\%\spacket\sloss', response ):
-                        pingResponse += str( " h" + str( temp[ 1: ] ) )
+                        pingResponse += str(" h" + str( temp[1:] ))
                     else:
                         pingResponse += " X"
                         # One of the host to host pair is unreachable
                         isReachable = main.FALSE
                         failedPings += 1
                 pingResponse += "\n"
-            main.log.info( pingResponse + "Failed pings: " + str( failedPings ) )
+            main.log.info( pingResponse + "Failed pings: " + str(failedPings) )
             return isReachable
         except pexpect.TIMEOUT:
             main.log.exception( self.name + ": TIMEOUT exception" )
@@ -513,23 +513,23 @@
                 pingList = hostList[ :listIndex ] + \
                     hostList[ ( listIndex + 1 ): ]
 
-                pingResponse += str( str( host ) + " -> " )
+                pingResponse += str(str(host) + " -> ")
 
                 for temp in pingList:
                     # Current host pings all other hosts specified
-                    pingCmd = str( host ) + cmd + str( self.getIPAddress( temp, proto='IPv6' ) )
+                    pingCmd = str( host ) + cmd + str( self.getIPAddress(temp,proto='IPv6') )
                     self.handle.sendline( pingCmd )
                     self.handle.expect( "mininet>", timeout=wait + 1 )
                     response = self.handle.before
                     if re.search( ',\s0\%\spacket\sloss', response ):
-                        pingResponse += str( " h" + str( temp[ 1: ] ) )
+                        pingResponse += str(" h" + str( temp[1:] ))
                     else:
                         pingResponse += " X"
                         # One of the host to host pair is unreachable
                         isReachable = main.FALSE
                         failedPings += 1
                 pingResponse += "\n"
-            main.log.info( pingResponse + "Failed pings: " + str( failedPings ) )
+            main.log.info( pingResponse + "Failed pings: " + str(failedPings) )
             return isReachable
 
         except pexpect.TIMEOUT:
@@ -549,7 +549,7 @@
         Currently the only supported Params: SRC, TARGET, and WAIT
         """
         args = utilities.parse_args( [ "SRC", "TARGET", 'WAIT' ], **pingParams )
-        wait = args[ 'WAIT' ]
+        wait = args['WAIT']
         wait = int( wait if wait else 1 )
         command = args[ "SRC" ] + " ping " + \
             args[ "TARGET" ] + " -c 1 -i 1 -W " + str( wait ) + " "
@@ -590,11 +590,11 @@
         """
            IPv6 Ping between a pair of mininet hosts
            Currently the only supported Params are: SRC, TARGET, and WAIT
-           FLOWLABEL and -I ( src interface ) will be added later after running some tests.
+           FLOWLABEL and -I (src interface) will be added later after running some tests.
            Example: main.Mininet1.ping6pair( src="h1", target="1000::2" )
         """
         args = utilities.parse_args( [ "SRC", "TARGET", 'WAIT' ], **pingParams )
-        wait = args[ 'WAIT' ]
+        wait = args['WAIT']
         wait = int( wait if wait else 1 )
         command = args[ "SRC" ] + " ping6 " + \
             args[ "TARGET" ] + " -c 1 -i 1 -W " + str( wait ) + " "
@@ -838,8 +838,8 @@
                 return main.TRUE
 
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -877,7 +877,7 @@
                 self.handle.expect( "mininet>" )
 
                 # Determine ip and mac address of the host-oldSw interface
-                cmd = "px ipaddr = " + str( IP )
+                cmd = "px ipaddr = " + str(IP)
                 print "cmd3= ", cmd
                 self.handle.sendline( cmd )
                 self.handle.expect( "mininet>" )
@@ -925,13 +925,13 @@
                 self.handle.expect( "mininet>" )
 
                 cmd = host + " ifconfig"
-                print "cmd9 =", cmd
-                response = self.execute( cmd=cmd, prompt="mininet>", timeout=10 )
+                print "cmd9 =",cmd
+                response = self.execute( cmd = cmd, prompt="mininet>" ,timeout=10 )
                 print response
                 pattern = "h\d-eth([\w])"
                 ipAddressSearch = re.search( pattern, response )
-                print ipAddressSearch.group( 1 )
-                intf = host + "-eth" + str( ipAddressSearch.group( 1 ) )
+                print ipAddressSearch.group(1)
+                intf= host + "-eth" + str(ipAddressSearch.group(1))
                 cmd = host + " ip -6 addr add %s dev %s" % ( IP, intf )
                 print "cmd10 = ", cmd
                 self.handle.sendline( cmd )
@@ -952,8 +952,8 @@
 
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -982,8 +982,8 @@
                     newIP )
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -1011,8 +1011,8 @@
                     newGW )
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -1040,8 +1040,8 @@
                     macaddr )
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -1064,8 +1064,8 @@
                 main.log.info( host + " arp -an = " + response )
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -1138,7 +1138,7 @@
         else:
             main.log.error( "Connection failed to the host" )
 
-    def getIPAddress( self, host, proto='IPV4' ):
+    def getIPAddress( self, host , proto='IPV4'):
         """
            Verifies the host's ip configured or not."""
         if self.handle:
@@ -1214,8 +1214,8 @@
                 response = self.handle.before
                 return response
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -1307,33 +1307,33 @@
             main.cleanAndExit()
         return response
 
-    def iperftcpAll( self, hosts, timeout=6 ):
-        """
+    def iperftcpAll(self, hosts, timeout=6):
+        '''
         Runs the iperftcp function with a given set of hosts and specified timeout.
 
         @parm:
             timeout: The defualt timeout is 6 sec to allow enough time for a successful test to complete,
              and short enough to stop an unsuccessful test from quiting and cleaning up mininet.
-        """
+        '''
         try:
             for host1 in hosts:
                 for host2 in hosts:
                     if host1 != host2:
-                        if self.iperftcp( host1, host2, timeout ) == main.FALSE:
-                            main.log.error( self.name + ": iperftcp test failed for " + host1 + " and " + host2 )
+                        if self.iperftcp(host1, host2, timeout) == main.FALSE:
+                            main.log.error(self.name + ": iperftcp test failed for " + host1 + " and " + host2)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def iperftcp( self, host1="h1", host2="h2", timeout=6 ):
-        """
+    def iperftcp(self, host1="h1", host2="h2", timeout=6):
+        '''
         Creates an iperf TCP test between two hosts. Returns main.TRUE if test results
         are valid.
 
         @parm:
             timeout: The defualt timeout is 6 sec to allow enough time for a successful test to complete,
              and short enough to stop an unsuccessful test from quiting and cleaning up mininet.
-        """
+        '''
         main.log.info( self.name + ": Simple iperf TCP test between two hosts" )
         try:
             # Setup the mininet command
@@ -1344,26 +1344,26 @@
 
             # checks if there are results in the mininet response
             if "Results:" in response:
-                main.log.report( self.name + ": iperf test completed" )
+                main.log.report(self.name + ": iperf test completed")
                 # parse the mn results
-                response = response.split( "\r\n" )
-                response = response[ len( response ) - 2 ]
-                response = response.split( ": " )
-                response = response[ len( response ) - 1 ]
-                response = response.replace( "[", "" )
-                response = response.replace( "]", "" )
-                response = response.replace( "\'", "" )
+                response = response.split("\r\n")
+                response = response[len(response)-2]
+                response = response.split(": ")
+                response = response[len(response)-1]
+                response = response.replace("[", "")
+                response = response.replace("]", "")
+                response = response.replace("\'", "")
 
                 # this is the bandwith two and from the two hosts
-                bandwidth = response.split( ", " )
+                bandwidth = response.split(", ")
 
                 # there should be two elements in the bandwidth list
-                # [ 'host1 to host2', 'host2 to host1" ]
-                if len( bandwidth ) == 2:
-                    main.log.report( self.name + ": iperf test successful" )
+                # ['host1 to host2', 'host2 to host1"]
+                if len(bandwidth) == 2:
+                    main.log.report(self.name + ": iperf test successful")
                     return main.TRUE
                 else:
-                    main.log.error( self.name + ": invalid iperf results" )
+                    main.log.error(self.name + ": invalid iperf results")
                     return main.FALSE
             else:
                 main.log.error( self.name + ": iperf test failed" )
@@ -1385,22 +1385,22 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def iperftcpipv6( self, host1="h1", host2="h2", timeout=50 ):
+    def iperftcpipv6(self, host1="h1", host2="h2", timeout=50):
         main.log.info( self.name + ": Simple iperf TCP test between two hosts" )
         try:
             IP1 = self.getIPAddress( host1, proto='IPV6' )
-            cmd1 = host1 + ' iperf -V -sD -B ' + str( IP1 )
+            cmd1 = host1 +' iperf -V -sD -B '+ str(IP1)
             self.handle.sendline( cmd1 )
-            outcome1 = self.handle.expect( "mininet>" )
-            cmd2 = host2 + ' iperf -V -c ' + str( IP1 ) + ' -t 5'
+            outcome1 = self.handle.expect( "mininet>")
+            cmd2 = host2 +' iperf -V -c '+ str(IP1) +' -t 5'
             self.handle.sendline( cmd2 )
-            outcome2 = self.handle.expect( "mininet>" )
+            outcome2 = self.handle.expect( "mininet>")
             response1 = self.handle.before
             response2 = self.handle.after
-            print response1, response2
-            pattern = "connected with " + str( IP1 )
+            print response1,response2
+            pattern = "connected with "+ str(IP1)
             if pattern in response1:
-                main.log.report( self.name + ": iperf test completed" )
+                main.log.report(self.name + ": iperf test completed")
                 return main.TRUE
             else:
                 main.log.error( self.name + ": iperf test failed" )
@@ -1420,76 +1420,77 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def iperfudpAll( self, hosts, bandwidth="10M" ):
-        """
+    def iperfudpAll(self, hosts, bandwidth="10M"):
+        '''
         Runs the iperfudp function with a given set of hosts and specified
         bandwidth
 
         @param:
-            bandwidth: the targeted bandwidth, in megabits ( 'M' )
-        """
+            bandwidth: the targeted bandwidth, in megabits ('M')
+        '''
         try:
             for host1 in hosts:
                 for host2 in hosts:
                     if host1 != host2:
-                        if self.iperfudp( host1, host2, bandwidth ) == main.FALSE:
-                            main.log.error( self.name + ": iperfudp test failed for " + host1 + " and " + host2 )
+                        if self.iperfudp(host1, host2, bandwidth) == main.FALSE:
+                            main.log.error(self.name + ": iperfudp test failed for " + host1 + " and " + host2)
         except TypeError:
-            main.log.exception( self.name + ": Object not as expected" )
+            main.log.exception(self.name + ": Object not as expected")
             return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def iperfudp( self, bandwidth="10M", host1="h1", host2="h2" ):
-        """
+    def iperfudp( self, bandwidth="10M", host1="h1", host2="h2"):
+
+        '''
         Creates an iperf UDP test with a specific bandwidth.
         Returns true if results are valid.
 
         @param:
-            bandwidth: the targeted bandwidth, in megabits ( 'M' ), to run the test
-        """
-        main.log.info( self.name + ": Simple iperf UDP test between two hosts" )
+            bandwidth: the targeted bandwidth, in megabits ('M'), to run the test
+        '''
+        main.log.info(self.name + ": Simple iperf UDP test between two hosts")
         try:
             # setup the mininet command
             cmd = 'iperfudp ' + bandwidth + " " + host1 + " " + host2
-            self.handle.sendline( cmd )
-            self.handle.expect( "mininet>" )
+            self.handle.sendline(cmd)
+            self.handle.expect("mininet>")
             response = self.handle.before
 
             # check if there are in results in the mininet response
             if "Results:" in response:
-                main.log.report( self.name + ": iperfudp test completed" )
+                main.log.report(self.name + ": iperfudp test completed")
                 # parse the results
-                response = response.split( "\r\n" )
-                response = response[ len( response ) - 2 ]
-                response = response.split( ": " )
-                response = response[ len( response ) - 1 ]
-                response = response.replace( "[", "" )
-                response = response.replace( "]", "" )
-                response = response.replace( "\'", "" )
+                response = response.split("\r\n")
+                response = response[len(response)-2]
+                response = response.split(": ")
+                response = response[len(response)-1]
+                response = response.replace("[", "")
+                response = response.replace("]", "")
+                response = response.replace("\'", "")
 
-                mnBandwidth = response.split( ", " )
+                mnBandwidth = response.split(", ")
 
                 # check to see if there are at least three entries
-                # [ 'bandwidth', 'host1 to host2', 'host2 to host1' ]
-                if len( mnBandwidth ) == 3:
+                # ['bandwidth', 'host1 to host2', 'host2 to host1']
+                if len(mnBandwidth) == 3:
                     # if one entry is blank then something is wrong
                     for item in mnBandwidth:
                         if item == "":
-                            main.log.error( self.name + ": Could not parse iperf output" )
-                            main.log.error( self.name + ": invalid iperfudp results" )
+                            main.log.error(self.name + ": Could not parse iperf output")
+                            main.log.error(self.name + ": invalid iperfudp results")
                             return main.FALSE
                     # otherwise results are vaild
-                    main.log.report( self.name + ": iperfudp test successful" )
+                    main.log.report(self.name + ": iperfudp test successful")
                     return main.TRUE
                 else:
-                    main.log.error( self.name + ": invalid iperfudp results" )
+                    main.log.error(self.name + ": invalid iperfudp results")
                     return main.FALSE
 
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1578,8 +1579,8 @@
             self.handle.sendline( command )
             self.handle.expect( "mininet>" )
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1599,7 +1600,7 @@
         main.log.info( command )
 
         try:
-            response = self.execute( cmd=command, prompt="mininet>" )
+            response = self.execute( cmd = command, prompt = "mininet>" )
             if re.search( "Unknown command", response ):
                 main.log.warn( response )
                 return main.FALSE
@@ -1741,7 +1742,7 @@
         Return:
             Returns main.TRUE if mininet correctly assigned switches to
             controllers, otherwise it will return main.FALSE or an appropriate
-            exception( s )
+            exception(s)
         """
         assignResult = main.TRUE
         # Initial ovs command
@@ -1948,9 +1949,9 @@
     def getSwitchRandom( self, timeout=60, nonCut=True ):
         """
         Randomly get a switch from Mininet topology.
-        If nonCut is True, it gets a list of non-cut switches ( the deletion
+        If nonCut is True, it gets a list of non-cut switches (the deletion
         of a non-cut switch will not increase the number of connected
-        components of a graph ) and randomly returns one of them, otherwise
+        components of a graph) and randomly returns one of them, otherwise
         it just randomly returns one switch from all current switches in
         Mininet.
         Returns the name of the chosen switch.
@@ -1965,11 +1966,11 @@
                     candidateSwitches.append( switchName )
             else:
                 graphDict = self.getGraphDict( timeout=timeout, useId=False )
-                if graphDict is None:
+                if graphDict == None:
                     return None
                 self.graph.update( graphDict )
                 candidateSwitches = self.graph.getNonCutVertices()
-            if candidateSwitches is None:
+            if candidateSwitches == None:
                 return None
             elif len( candidateSwitches ) == 0:
                 main.log.info( self.name + ": No candidate switch for deletion" )
@@ -1990,16 +1991,16 @@
     def delSwitchRandom( self, timeout=60, nonCut=True ):
         """
         Randomly delete a switch from Mininet topology.
-        If nonCut is True, it gets a list of non-cut switches ( the deletion
+        If nonCut is True, it gets a list of non-cut switches (the deletion
         of a non-cut switch will not increase the number of connected
-        components of a graph ) and randomly chooses one for deletion,
+        components of a graph) and randomly chooses one for deletion,
         otherwise it just randomly delete one switch from all current
         switches in Mininet.
         Returns the name of the deleted switch
         """
         try:
             switch = self.getSwitchRandom( timeout, nonCut )
-            if switch is None:
+            if switch == None:
                 return None
             else:
                 deletionResult = self.delSwitch( switch )
@@ -2084,9 +2085,9 @@
     def getLinkRandom( self, timeout=60, nonCut=True ):
         """
         Randomly get a link from Mininet topology.
-        If nonCut is True, it gets a list of non-cut links ( the deletion
+        If nonCut is True, it gets a list of non-cut links (the deletion
         of a non-cut link will not increase the number of connected
-        component of a graph ) and randomly returns one of them, otherwise
+        component of a graph) and randomly returns one of them, otherwise
         it just randomly returns one link from all current links in
         Mininet.
         Returns the link as a list, e.g. [ 's1', 's2' ]
@@ -2104,11 +2105,11 @@
                     candidateLinks.append( [ link[ 'node1' ], link[ 'node2' ] ] )
             else:
                 graphDict = self.getGraphDict( timeout=timeout, useId=False )
-                if graphDict is None:
+                if graphDict == None:
                     return None
                 self.graph.update( graphDict )
                 candidateLinks = self.graph.getNonCutEdges()
-            if candidateLinks is None:
+            if candidateLinks == None:
                 return None
             elif len( candidateLinks ) == 0:
                 main.log.info( self.name + ": No candidate link for deletion" )
@@ -2129,16 +2130,16 @@
     def delLinkRandom( self, timeout=60, nonCut=True ):
         """
         Randomly delete a link from Mininet topology.
-        If nonCut is True, it gets a list of non-cut links ( the deletion
+        If nonCut is True, it gets a list of non-cut links (the deletion
         of a non-cut link will not increase the number of connected
-        component of a graph ) and randomly chooses one for deletion,
+        component of a graph) and randomly chooses one for deletion,
         otherwise it just randomly delete one link from all current links
         in Mininet.
         Returns the deleted link as a list, e.g. [ 's1', 's2' ]
         """
         try:
             link = self.getLinkRandom( timeout, nonCut )
-            if link is None:
+            if link == None:
                 return None
             else:
                 deletionResult = self.delLink( link[ 0 ], link[ 1 ] )
@@ -2301,8 +2302,8 @@
                         fileName +
                         "\" | grep -v grep | awk '{print $2}'\`" )
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -2330,7 +2331,7 @@
             ethDevice = '-I ' + ethDevice + ' '
         cmd = srcHost + " arping -c1 "
         if noResult:
-            cmd += "-w10 "  # If we don't want the actural arping result, set -w10, arping will exit after 10 ms.
+            cmd += "-w10 " # If we don't want the actural arping result, set -w10, arping will exit after 10 ms.
         cmd += ethDevice + dstHost
         try:
             if output:
@@ -2415,11 +2416,11 @@
             assert flowTable1, "flowTable1 is empty or None"
             assert flowTable2, "flowTable2 is empty or None"
             returnValue = main.TRUE
-            if len( flowTable1 ) != len( flowTable2 ):
+            if len(flowTable1) != len(flowTable2):
                 main.log.warn( "Flow table lengths do not match" )
                 returnValue = main.FALSE
-            dFields = [ "n_bytes", "cookie", "n_packets", "duration" ]
-            for flow1, flow2 in zip( flowTable1, flowTable2 ):
+            dFields = ["n_bytes", "cookie", "n_packets", "duration"]
+            for flow1, flow2 in zip(flowTable1, flowTable2):
                 for field in dFields:
                     try:
                         flow1.pop( field )
@@ -2429,10 +2430,10 @@
                         flow2.pop( field )
                     except KeyError:
                         pass
-            for i in range( len( flowTable1 ) ):
-                if flowTable1[ i ] not in flowTable2:
+            for i in range( len(flowTable1) ):
+                if flowTable1[i] not in flowTable2:
                     main.log.warn( "Flow tables do not match:" )
-                    main.log.warn( "Old flow:\n{}\n not in new flow table".format( flowTable1[ i ] ) )
+                    main.log.warn( "Old flow:\n{}\n not in new flow table".format( flowTable1[i] ) )
                     returnValue = main.FALSE
                     break
             return returnValue
@@ -2444,7 +2445,7 @@
             main.cleanAndExit()
 
     def parseFlowTable( self, flowTable, version="", debug=True ):
-        """
+        '''
         Discription: Parses flows into json format.
         NOTE: this can parse any string thats separated with commas
         Arguments:
@@ -2454,70 +2455,69 @@
                 version: The version of OpenFlow. Currently, 1.3 and 1.0 are supported.
                 debug: prints out the final result
         returns: A list of flows in json format
-        """
+        '''
         jsonFlowTable = []
         try:
             for flow in flowTable:
                 jsonFlow = {}
                 # split up the fields of the flow
-                parsedFlow = flow.split( ", " )
+                parsedFlow = flow.split(", ")
                 # get rid of any spaces in front of the field
-                for i in range( len( parsedFlow ) ):
-                    item = parsedFlow[ i ]
-                    if item[ 0 ] == " ":
-                        parsedFlow[ i ] = item[ 1: ]
+                for i in range( len(parsedFlow) ):
+                    item = parsedFlow[i]
+                    if item[0] == " ":
+                        parsedFlow[i] = item[1:]
                 # grab the selector and treatment from the parsed flow
                 # the last element is the selector and the treatment
-                temp = parsedFlow.pop( -1 )
+                temp = parsedFlow.pop(-1)
                 # split up the selector and the treatment
-                temp = temp.split( " " )
+                temp = temp.split(" ")
                 index = 0
                 # parse the flags
                 # NOTE: This only parses one flag
                 flag = {}
                 if version == "1.3":
-                    flag = { "flag": [ temp[ index ] ] }
+                    flag = {"flag":[temp[index]]}
                     index += 1
                 # the first element is the selector and split it up
-                sel = temp[ index ]
+                sel = temp[index]
                 index += 1
-                sel = sel.split( "," )
+                sel = sel.split(",")
                 # the priority is stuck in the selecter so put it back
                 # in the flow
-                parsedFlow.append( sel.pop( 0 ) )
+                parsedFlow.append(sel.pop(0))
                 # parse selector
                 criteria = []
                 for item in sel:
                     # this is the type of the packet e.g. "arp"
                     if "=" not in item:
-                        criteria.append( { "type": item } )
+                        criteria.append( {"type":item} )
                     else:
-                        field = item.split( "=" )
-                        criteria.append( { field[ 0 ]: field[ 1 ] } )
-                selector = { "selector": { "criteria": sorted( criteria ) } }
-                treat = temp[ index ]
+                        field = item.split("=")
+                        criteria.append( {field[0]:field[1]} )
+                selector = {"selector": {"criteria":sorted(criteria)} }
+                treat = temp[index]
                 # get rid of the action part e.g. "action=output:2"
                 # we will add it back later
-                treat = treat.split( "=" )
-                treat.pop( 0 )
+                treat = treat.split("=")
+                treat.pop(0)
                 # parse treatment
                 action = []
                 for item in treat:
-                    field = item.split( ":" )
-                    action.append( { field[ 0 ]: field[ 1 ] } )
+                    field = item.split(":")
+                    action.append( {field[0]:field[1]} )
                 # create the treatment field and add the actions
-                treatment = { "treatment": { "action": sorted( action ) } }
+                treatment = {"treatment": {"action":sorted(action)} }
                 # parse the rest of the flow
                 for item in parsedFlow:
-                    field = item.split( "=" )
-                    jsonFlow.update( { field[ 0 ]: field[ 1 ] } )
+                    field = item.split("=")
+                    jsonFlow.update( {field[0]:field[1]} )
                 # add the treatment and the selector to the json flow
                 jsonFlow.update( selector )
                 jsonFlow.update( treatment )
                 jsonFlow.update( flag )
 
-                if debug:
-                    main.log.debug( "\033[94mJson flow:\033[0m\n{}\n".format( jsonFlow ) )
+                if debug: main.log.debug( "\033[94mJson flow:\033[0m\n{}\n".format(jsonFlow) )
 
                 # add the json flow to the json flow table
                 jsonFlowTable.append( jsonFlow )
@@ -2535,24 +2535,23 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def getFlowTable( self, sw, version="", debug=False ):
-        """
-        Discription: Returns the flow table( s ) on a switch or switches in a list.
+    def getFlowTable( self, sw, version="", debug=False):
+        '''
+        Discription: Returns the flow table(s) on a switch or switches in a list.
             Each element is a flow.
         Arguments:
             Required:
-                sw: The switch name ( "s1" ) to retrive the flow table. Can also be
+                sw: The switch name ("s1") to retrive the flow table. Can also be
                     a list of switches.
             Optional:
                 version: The version of OpenFlow. Currently, 1.3 and 1.0 are supported.
                 debug: prints out the final result
-        """
+        '''
         try:
             switches = []
-            if isinstance( sw, list ):
-                switches.extend( sw )
-            else:
-                switches.append( sw )
+            if type(sw) is list:
+                switches.extend(sw)
+            else: switches.append(sw)
 
             flows = []
             for s in switches:
@@ -2572,11 +2571,10 @@
                 # the first element is the command that was sent
                 # the second is the table header
                 # the last element is empty
-                response = response[ 2:-1 ]
+                response = response[2:-1]
                 flows.extend( response )
 
-            if debug:
-                print "Flows:\n{}\n\n".format( flows )
+            if debug: print "Flows:\n{}\n\n".format(flows)
 
             return self.parseFlowTable( flows, version, debug )
 
@@ -2588,11 +2586,11 @@
             main.cleanAndExit()
 
     def checkFlowId( self, sw, flowId, version="1.3", debug=True ):
-        """
+        '''
         Discription: Checks whether the ID provided matches a flow ID in Mininet
         Arguments:
             Required:
-                sw: The switch name ( "s1" ) to retrive the flow table. Can also be
+                sw: The switch name ("s1") to retrive the flow table. Can also be
                     a list of switches.
                 flowId: the flow ID in hex format. Can also be a list of IDs
             Optional:
@@ -2600,18 +2598,17 @@
                 debug: prints out the final result
         returns: main.TRUE if all IDs are present, otherwise returns main.FALSE
         NOTE: prints out IDs that are not present
-        """
+        '''
         try:
             main.log.info( "Getting flows from Mininet" )
             flows = self.getFlowTable( sw, version, debug )
-            if flows is None:
+            if flows == None:
                 return main.ERROR
 
-            if debug:
-                print "flow ids:\n{}\n\n".format( flowId )
+            if debug: print "flow ids:\n{}\n\n".format(flowId)
 
             # Check flowId is a list or a string
-            if isinstance( flowId, str ):
+            if type( flowId ) is str:
                 result = False
                 for f in flows:
                     if flowId in f.get( 'cookie' ):
@@ -2625,8 +2622,7 @@
                 # Save the IDs that are not in Mininet
                 absentIds = [ x for x in flowId if x not in mnFlowIds ]
 
-                if debug:
-                    print "mn flow ids:\n{}\n\n".format( mnFlowIds )
+                if debug: print "mn flow ids:\n{}\n\n".format(mnFlowIds)
 
                 # Print out the IDs that are not in Mininet
                 if absentIds:
@@ -2643,6 +2639,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+
     def startTcpdump( self, filename, intf="eth0", port="port 6653" ):
         """
            Runs tpdump on an interface and saves the file
@@ -2707,8 +2704,8 @@
             self.handle.sendline( "" )
             self.handle.expect( "mininet>" )
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -2789,7 +2786,7 @@
                 for line in response.split( "\n" ):
                     # Regex patterns to parse 'ovs-ofctl dump-ports-desc' output
                     # Example port:
-                    # 1( s1-eth1 ): addr:ae:60:72:77:55:51
+                    # 1(s1-eth1): addr:ae:60:72:77:55:51
                     pattern = "(?P<index>\d+)\((?P<name>[^-]+-eth(?P<port>\d+))\):\saddr:(?P<mac>([a-f0-9]{2}:){5}[a-f0-9]{2})"
                     result = re.search( pattern, line )
                     if result:
@@ -2889,7 +2886,7 @@
             dump = self.dump().split( "\n" )
             hosts = {}
             for line in dump:
-                if "Host" in line:
+                if "Host" in line :
                     result = re.search( hostRE, line )
                     name = result.group( 'name' )
                     interfaces = []
@@ -2950,12 +2947,12 @@
               hosts, this is just the eth#.
         """
         try:
-            self.update( updateTimeout )
-            response = self.links( timeout=timeout ).split( '\n' )
+            self.update()
+            response = self.links(timeout=timeout).split( '\n' )
 
             # Examples:
-            # s1-eth3<->s2-eth1 ( OK OK )
-            # s13-eth3<->h27-eth0 ( OK OK )
+            # s1-eth3<->s2-eth1 (OK OK)
+            # s13-eth3<->h27-eth0 (OK OK)
             linkRE = "(?P<node1>[\w]+)\-eth(?P<port1>[\d]+)\<\-\>" +\
                      "(?P<node2>[\w]+)\-eth(?P<port2>[\d]+)"
             links = []
@@ -3274,11 +3271,11 @@
                     main.log.info( output )
             return hostResults
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
 
     def getHostsOld( self ):
@@ -3307,8 +3304,8 @@
 
             return hostList
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -3350,7 +3347,7 @@
             nodesList = nodesStr.split( "," )
 
             nodesSet = set( nodesList )
-            # discarding default controller( s ) node
+            # discarding default controller(s) node
             nodesSet.discard( 'c0' )
             nodesSet.discard( 'c1' )
             nodesSet.discard( 'c2' )
@@ -3360,8 +3357,8 @@
 
             return switchList
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -3380,7 +3377,7 @@
           vertex2: { 'edges': ..., 'name': ..., 'protocol': ... } }
         Each vertex should at least have an 'edges' attribute which describes the
         adjacency information. The value of 'edges' attribute is also represented by
-        a dictionary, which maps each edge ( identified by the neighbor vertex ) to a
+        a dictionary, which maps each edge (identified by the neighbor vertex) to a
         list of attributes.
         An example of the edges dictionary:
         'edges': { vertex2: { 'port': ..., 'weight': ... },
@@ -3388,7 +3385,7 @@
         If useId == True, dpid/mac will be used instead of names to identify
         vertices, which is helpful when e.g. comparing Mininet topology with ONOS
         topology.
-        If includeHost == True, all hosts ( and host-switch links ) will be included
+        If includeHost == True, all hosts (and host-switch links) will be included
         in topology data.
         Note that link or switch that are brought down by 'link x x down' or 'switch
         x down' commands still show in the output of Mininet CLI commands such as
@@ -3417,7 +3414,7 @@
                     # Get port index from OVS
                     # The index extracted from port name may be inconsistent with ONOS
                     portIndex = -1
-                    if nodeName1 not in portDict.keys():
+                    if not nodeName1 in portDict.keys():
                         portList = self.getOVSPorts( nodeName1 )
                         if len( portList ) == 0:
                             main.log.warn( self.name + ": No port found on switch " + nodeName1 )
@@ -3436,21 +3433,21 @@
                     else:
                         node1 = nodeName1
                         node2 = nodeName2
-                    if node1 not in graphDict.keys():
+                    if not node1 in graphDict.keys():
                         if useId:
-                            graphDict[ node1 ] = { 'edges': {},
-                                                   'dpid': switches[ nodeName1 ][ 'dpid' ],
-                                                   'name': nodeName1,
-                                                   'ports': switches[ nodeName1 ][ 'ports' ],
-                                                   'swClass': switches[ nodeName1 ][ 'swClass' ],
-                                                   'pid': switches[ nodeName1 ][ 'pid' ],
-                                                   'options': switches[ nodeName1 ][ 'options' ] }
+                            graphDict[ node1 ] = { 'edges':{},
+                                                   'dpid':switches[ nodeName1 ][ 'dpid' ],
+                                                   'name':nodeName1,
+                                                   'ports':switches[ nodeName1 ][ 'ports' ],
+                                                   'swClass':switches[ nodeName1 ][ 'swClass' ],
+                                                   'pid':switches[ nodeName1 ][ 'pid' ],
+                                                   'options':switches[ nodeName1 ][ 'options' ] }
                         else:
-                            graphDict[ node1 ] = { 'edges': {} }
+                            graphDict[ node1 ] = { 'edges':{} }
                     else:
                         # Assert node2 is not connected to any current links of node1
                         assert node2 not in graphDict[ node1 ][ 'edges' ].keys()
-                    graphDict[ node1 ][ 'edges' ][ node2 ] = { 'port': portIndex }
+                    graphDict[ node1 ][ 'edges' ][ node2 ] = { 'port':portIndex }
                     # Swap two nodes/ports
                     nodeName1, nodeName2 = nodeName2, nodeName1
                     port1, port2 = port2, port1
@@ -3487,8 +3484,8 @@
 
             return main.TRUE
         except pexpect.TIMEOUT:
-            main.log.error( self.name + ": TIMEOUT exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": TIMEOUT exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -3548,8 +3545,8 @@
 
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.error( self.name + ": TIMEOUT exception found" )
-                main.log.error( self.name + ":     " + self.handle.before )
+                main.log.error(self.name + ": TIMEOUT exception found")
+                main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
@@ -3575,8 +3572,8 @@
             getattr( main, name )
         except AttributeError:
             # namespace is clear, creating component
-            main.componentDictionary[ name ] = main.componentDictionary[ self.name ].copy()
-            main.componentDictionary[ name ][ 'connect_order' ] = str( int( main.componentDictionary[ name ][ 'connect_order' ] ) + 1 )
+            main.componentDictionary[name] = main.componentDictionary[self.name].copy()
+            main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
             main.componentInit( name )
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -3609,7 +3606,7 @@
             # Delete component
             delattr( main, name )
             # Delete component from ComponentDictionary
-            del( main.componentDictionary[ name ] )
+            del( main.componentDictionary[name] )
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
@@ -3645,7 +3642,8 @@
             main.cleanAndExit()
 
     def changeInterfaceStatus( self, devicename, intf, status ):
-        """
+        '''
+
         Args:
             devicename: switch name
             intf: port name on switch
@@ -3653,29 +3651,30 @@
 
         Returns: boolean to show success change status
 
-        """
+        '''
         if status == "down" or status == "up":
             try:
                 cmd = devicename + " ifconfig " + intf + " " + status
                 self.handle.sendline( cmd )
-                self.handle.expect( "mininet>" )
+                self.handle.expect("mininet>")
                 return main.TRUE
             except pexpect.TIMEOUT:
-                main.log.exception( self.name + ": Command timed out" )
+                main.log.exception(self.name + ": Command timed out")
                 return main.FALSE
             except pexpect.EOF:
-                main.log.exception( self.name + ": connection closed." )
+                main.log.exception(self.name + ": connection closed.")
                 main.cleanAndExit()
             except TypeError:
-                main.log.exception( self.name + ": TypeError" )
+                main.log.exception(self.name + ": TypeError")
                 main.cleanAndExit()
             except Exception:
-                main.log.exception( self.name + ": Uncaught exception!" )
+                main.log.exception(self.name + ": Uncaught exception!")
                 main.cleanAndExit()
         else:
-            main.log.warn( "Interface status should be up or down!" )
+            main.log.warn("Interface status should be up or down!")
             return main.FALSE
 
 
+
 if __name__ != "__main__":
     sys.modules[ __name__ ] = MininetCliDriver()
diff --git a/TestON/drivers/common/cli/emulator/poxclidriver.py b/TestON/drivers/common/cli/emulator/poxclidriver.py
index ec22d0b..de7a7c3 100644
--- a/TestON/drivers/common/cli/emulator/poxclidriver.py
+++ b/TestON/drivers/common/cli/emulator/poxclidriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -45,7 +45,7 @@
         self.wrapped = sys.modules[ __name__ ]
 
     def connect( self, **connectargs ):
-        # user_name, ip_address, pwd,options ):
+        #,user_name, ip_address, pwd,options ):
         """
           this subroutine is to launch pox controller . It must have arguments as :
           user_name  = host name ,
diff --git a/TestON/drivers/common/cli/emulator/remotemininetdriver.py b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
index 6deca9a..71de94c 100644
--- a/TestON/drivers/common/cli/emulator/remotemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -56,7 +56,7 @@
             self.name = self.options[ 'name' ]
 
             try:
-                if os.getenv( str( self.ip_address ) ) is not None:
+                if os.getenv( str( self.ip_address ) ) != None:
                     self.ip_address = os.getenv( str( self.ip_address ) )
                 else:
                     main.log.info( self.name +
@@ -152,7 +152,7 @@
             self.handle.expect( self.prompt )
             return main.TRUE
         except TypeError:
-            main.log.exception( self.name + ": Object not as expected" )
+            main.log.exception(self.name + ": Object not as expected")
             return main.FALSE
         except pexpect.TIMEOUT:
             main.log.exception( self.name + ": TIMEOUT exception found in pingLong" )
@@ -166,6 +166,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+
     def pingstatus( self, **pingParams ):
         """
         Tails the respective ping output file and check that
@@ -202,7 +203,7 @@
             main.log.error( self.name + ":     " + self.handle.before )
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
 
     def pingKill( self, testONUser, testONIP ):
@@ -261,11 +262,11 @@
             main.log.error( self.name + ":    " + self.handle.before )
             return main.FALSE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":    " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":    " + self.handle.before)
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
 
     def pingHostOptical( self, **pingParams ):
@@ -335,11 +336,11 @@
                 main.lastResult = main.FALSE
                 return main.FALSE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":    " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":    " + self.handle.before)
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
 
     def checknum( self, num ):
@@ -406,7 +407,7 @@
             self.handle.sendline( "" )
             self.handle.sendline( "" )
             i = self.handle.expect( [ 'No\ssuch\device', 'listening\son',
-                                      pexpect.TIMEOUT, self.prompt ], timeout=10 )
+                                    pexpect.TIMEOUT, self.prompt ], timeout=10 )
             main.log.info( self.handle.before + self.handle.after )
             if i == 0:
                 main.log.error( self.name + ": tcpdump - No such device exists.\
@@ -457,9 +458,9 @@
                 It runs python script "opticalTest.py" to create the
                 packet layer( mn ) and optical topology
             Optional:
-                name - Name of onos directory. ( ONOS | onos )
+                name - Name of onos directory. (ONOS | onos)
             Required:
-                ctrllerIP = Controller( s ) IP address
+                ctrllerIP = Controller(s) IP address
             TODO: If no ctrllerIP is provided, a default
                 $OC1 can be accepted
         """
@@ -467,15 +468,15 @@
             self.handle.sendline( "" )
             self.handle.expect( self.prompt )
             self.handle.sendline( "cd ~/" + name + "/tools/test/topos" )
-            self.handle.expect( "topos" + self.prompt )
-            if ctrllerIP is None:
+            self.handle.expect( "topos"+ self.prompt )
+            if ctrllerIP == None:
                 main.log.info( "You need to specify the IP" )
                 return main.FALSE
             else:
                 controller = ''
                 if isinstance( ctrllerIP, types.ListType ):
                     for i in xrange( len( ctrllerIP ) ):
-                        controller += ctrllerIP[ i ] + ' '
+                        controller += ctrllerIP[i] + ' '
                     main.log.info( "Mininet topology is being loaded with " +
                                    "controllers: " + controller )
                 elif isinstance( ctrllerIP, types.StringType ):
@@ -488,10 +489,10 @@
                 cmd = "sudo -E python opticalTest.py " + controller
                 main.log.info( self.name + ": cmd = " + cmd )
                 self.handle.sendline( cmd )
-                time.sleep( 30 )
+                time.sleep(30)
                 self.handle.sendline( "" )
                 self.handle.sendline( "" )
-                self.handle.expect( "mininet>" )
+                self.handle.expect("mininet>")
                 return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -502,7 +503,7 @@
         """
             Since executing opticalTest.py will give you mininet
             prompt, you would at some point require to get onto
-            console of LincOE ( ( linc@onosTestBench )1> ) to execute
+            console of LincOE ((linc@onosTestBench)1>) to execute
             commands like bring a optical port up or down on a ROADM
             You can attach to console of Linc-OE session by a cmd:
             sudo ~/linc-oe/rel/linc/bin/linc attach
@@ -535,7 +536,7 @@
                 elif i == 1:
                     self.handle.sendline( "exit" )
                     self.handle.expect( "exit" )
-                    self.handle.expect( self.prompt )
+                    self.handle.expect(self.prompt)
                     self.handle.sendline( "exit" )
                     self.handle.expect( "exit" )
                     self.handle.expect( "closed" )
@@ -547,11 +548,11 @@
             main.log.error( self.name + ":    " + self.handle.before )
             return main.FALSE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":    " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":    " + self.handle.before)
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception(self.name + ": Uncaught exception!")
             main.cleanAndExit()
 
     def setIpTablesOUTPUT( self, dstIp, dstPort, action='add',
diff --git a/TestON/drivers/common/cli/emulatordriver.py b/TestON/drivers/common/cli/emulatordriver.py
index 9bfd648..f63a49f 100644
--- a/TestON/drivers/common/cli/emulatordriver.py
+++ b/TestON/drivers/common/cli/emulatordriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -26,7 +26,6 @@
 """
 from drivers.common.clidriver import CLI
 
-
 class Emulator( CLI ):
     # The common functions for emulator included in emulatordriver
 
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
old mode 100644
new mode 100755
index 4807763..f7f488d
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -2,7 +2,7 @@
 
 """
 OCT 13 2014
-Copyright 2014 Open Networking Foundation ( ONF )
+Copyright 2014 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -11,7 +11,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,6 +21,7 @@
     You should have received a copy of the GNU General Public License
     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 """
+
 """
 This driver enters the onos> prompt to issue commands.
 
@@ -46,7 +47,6 @@
 from cStringIO import StringIO
 from itertools import izip
 
-
 class OnosCliDriver( CLI ):
 
     def __init__( self ):
@@ -61,11 +61,10 @@
         self.graph = Graph()
         super( OnosCliDriver, self ).__init__()
 
-    def checkOptions( self, var, defaultVar ):
+    def checkOptions(self, var, defaultVar):
         if var is None or var == "":
             return defaultVar
         return var
-
     def connect( self, **connectargs ):
         """
         Creates ssh handle for ONOS cli.
@@ -82,9 +81,9 @@
                 elif key == "karaf_password":
                     self.karafPass = self.options[ key ]
 
-            self.home = self.checkOptions( self.home, "~/onos" )
-            self.karafUser = self.checkOptions( self.karafUser, self.user_name )
-            self.karafPass = self.checkOptions( self.karafPass, self.pwd )
+            self.home = self.checkOptions(self.home, "~/onos")
+            self.karafUser = self.checkOptions(self.karafUser, self.user_name)
+            self.karafPass = self.checkOptions(self.karafPass, self.pwd )
 
             for key in self.options:
                 if key == 'onosIp':
@@ -164,7 +163,7 @@
         """
         Sends 'logout' command to ONOS cli
         Returns main.TRUE if exited CLI and
-                main.FALSE on timeout ( not guranteed you are disconnected )
+                main.FALSE on timeout (not guranteed you are disconnected)
                 None on TypeError
                 Exits test on unknown error or pexpect exits unexpectedly
         """
@@ -228,12 +227,12 @@
                 # Expect the cellname in the ONOSCELL variable.
                 # Note that this variable name is subject to change
                 #   and that this driver will have to change accordingly
-                self.handle.expect( str( cellname ) )
+                self.handle.expect(str(cellname))
                 handleBefore = self.handle.before
                 handleAfter = self.handle.after
                 # Get the rest of the handle
-                self.handle.sendline( "" )
-                self.handle.expect( self.prompt )
+                self.handle.sendline("")
+                self.handle.expect(self.prompt)
                 handleMore = self.handle.before
 
                 main.log.info( "Cell call returned: " + handleBefore +
@@ -273,7 +272,7 @@
             # Check if we are already in the cli
             self.handle.sendline( "" )
             x = self.handle.expect( [
-                self.prompt, "onos>" ], commandlineTimeout )
+                self.prompt, "onos>" ], commandlineTimeout)
             if x == 1:
                 main.log.info( "ONOS cli is already running" )
                 return main.TRUE
@@ -352,10 +351,11 @@
         Note: karafTimeout is left as str so that this could be read
         and passed to startOnosCli from PARAMS file as str.
         """
+
         try:
             self.handle.sendline( "" )
             x = self.handle.expect( [
-                self.prompt, "onos>" ], commandlineTimeout )
+                self.prompt, "onos>" ], commandlineTimeout)
 
             if x == 1:
                 main.log.info( "ONOS cli is already running" )
@@ -478,7 +478,7 @@
             self.handle.sendline( "" )
             i = self.handle.expect( [ "onos>", self.prompt, pexpect.TIMEOUT ] )
             if i == 1:
-                main.log.error( self.name + ": onos cli session closed. " )
+                main.log.error( self.name + ": onos cli session closed. ")
                 if self.onosIp:
                     main.log.warn( "Trying to reconnect " + self.onosIp )
                     reconnectResult = self.startOnosCli( self.onosIp )
@@ -504,12 +504,12 @@
                 self.log( logStr, noExit=noExit )
             self.handle.sendline( cmdStr )
             if dollarSign:
-                i = self.handle.expect( [ "onos>" ], timeout )
+                i = self.handle.expect( ["onos>"], timeout )
             else:
-                i = self.handle.expect( [ "onos>", self.prompt ], timeout )
+                i = self.handle.expect( ["onos>", self.prompt], timeout )
             response = self.handle.before
             # TODO: do something with i
-            main.log.info( "Command '" + str(cmdStr) + "' sent to "
+            main.log.info( "Command '" + str( cmdStr ) + "' sent to "
                            + self.name + "." )
             if debug:
                 main.log.debug( self.name + ": Raw output" )
@@ -523,7 +523,7 @@
                 main.log.debug( self.name + ": " + repr( response ) )
 
             # Remove extra return chars that get added
-            response = re.sub( r"\s\r", "", response )
+            response = re.sub(  r"\s\r", "", response )
             if debug:
                 main.log.debug( self.name + ": Removed extra returns " +
                                 "from output" )
@@ -541,7 +541,7 @@
                 main.log.debug( self.name + ": split output" )
                 for r in output:
                     main.log.debug( self.name + ": " + repr( r ) )
-            output = output[ 1 ].strip()
+            output = output[1].strip()
             if showResponse:
                 main.log.info( "Response from ONOS: {}".format( output ) )
             return output
@@ -647,7 +647,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def nodes( self, jsonFormat=True ):
+    def nodes( self, jsonFormat=True):
         """
         List the nodes currently visible
         Issues command: 'nodes'
@@ -794,7 +794,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def checkMasters( self, jsonFormat=True ):
+    def checkMasters( self, jsonFormat=True  ):
         """
             Returns the output of the masters command.
             Optional argument:
@@ -852,7 +852,7 @@
                     main.log.info( "\n" + self.checkMasters( False ) )
                     return main.FALSE
             main.log.info( "Mastership balanced between " +
-                           str( len( masters ) ) + " masters" )
+                           str( len(masters) ) + " masters" )
             return main.TRUE
         except ( TypeError, ValueError ):
             main.log.exception( "{}: Object not as expected: {!r}".format( self.name, mastersOutput ) )
@@ -1186,9 +1186,9 @@
             else:
                 main.log.info( "Host intent installed between " +
                                str( hostIdOne ) + " and " + str( hostIdTwo ) )
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     main.log.debug( "Response from ONOS was: " +
@@ -1234,9 +1234,9 @@
                 main.log.info( "Optical intent installed between " +
                                str( ingressDevice ) + " and " +
                                str( egressDevice ) )
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     return None
@@ -1374,9 +1374,9 @@
                 main.log.info( "Point-to-point intent installed between " +
                                str( ingressDevice ) + " and " +
                                str( egressDevice ) )
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     return None
@@ -1532,9 +1532,9 @@
                                 "intent" )
                 return None
             else:
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     return None
@@ -1691,9 +1691,9 @@
                                 "intent" )
                 return None
             else:
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     return None
@@ -1729,7 +1729,7 @@
             tcpDst="",
             ingressLabel="",
             egressLabel="",
-            priority="" ):
+            priority=""):
         """
         Required:
             * ingressDevice: device id of ingress device
@@ -1824,9 +1824,9 @@
                 main.log.info( "MPLS intent installed between " +
                                str( ingressDevice ) + " and " +
                                str( egressDevice ) )
-                match = re.search( 'id=0x([\da-f]+),', handle )
+                match = re.search('id=0x([\da-f]+),', handle)
                 if match:
-                    return match.group()[ 3:-1 ]
+                    return match.group()[3:-1]
                 else:
                     main.log.error( "Error, intent ID not found" )
                     return None
@@ -2000,7 +2000,7 @@
             assert handle is not None, "Error in sendline"
             assert "Command not found:" not in handle, handle
             jsonResult = json.loads( handle )
-            return len( jsonResult[ 'routes4' ] )
+            return len(jsonResult['routes4'])
         except AssertionError:
             main.log.exception( "" )
             return None
@@ -2015,8 +2015,8 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    # =============Function to check Bandwidth allocation========
-    def allocations( self, jsonFormat=True, dollarSign=True ):
+    #=============Function to check Bandwidth allocation========
+    def allocations( self, jsonFormat = True, dollarSign = True ):
         """
         Description:
             Obtain Bandwidth Allocation Information from ONOS cli.
@@ -2043,7 +2043,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def intents( self, jsonFormat=True, summary=False, **intentargs ):
+    def intents( self, jsonFormat = True, summary = False, **intentargs):
         """
         Description:
             Obtain intents from the ONOS cli.
@@ -2091,21 +2091,22 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def getIntentState( self, intentsId, intentsJson=None ):
+    def getIntentState(self, intentsId, intentsJson=None):
         """
         Description:
-            Gets intent state. Accepts a single intent ID ( string type ) or a
+            Gets intent state. Accepts a single intent ID (string type) or a
             list of intent IDs.
         Parameters:
             intentsId: intent ID, both string type and list type are acceptable
             intentsJson: parsed json object from the onos:intents api
         Returns:
-            Returns the state ( string type ) of the ID if a single intent ID is
+            Returns the state (string type) of the ID if a single intent ID is
             accepted.
             Returns a list of dictionaries if a list of intent IDs is accepted,
             and each dictionary maps 'id' to the Intent ID and 'state' to
             corresponding intent state.
         """
+
         try:
             state = "State is Undefined"
             if not intentsJson:
@@ -2156,7 +2157,7 @@
         Required:
             intentsId - List of intents ID to be checked
         Optional:
-            expectedState - Check the expected state( s ) of each intents
+            expectedState - Check the expected state(s) of each intents
                             state in the list.
                             *NOTE: You can pass in a list of expected state,
                             Eg: expectedState = [ 'INSTALLED' , 'INSTALLING' ]
@@ -2168,15 +2169,15 @@
             returnValue = main.TRUE
             # Generating a dictionary: intent id as a key and state as value
 
-            # intentsDict = self.getIntentState( intentsId )
+            #intentsDict = self.getIntentState( intentsId )
             intentsDict = []
             for intent in json.loads( self.intents() ):
-                if isinstance( intentsId, types.StringType ) \
-                        and intent.get( 'id' ) == intentsId:
-                    intentsDict.append( intent )
-                elif isinstance( intentsId, types.ListType ) \
+                if isinstance ( intentsId, types.StringType) \
+                        and intent.get('id') == intentsId:
+                    intentsDict.append(intent)
+                elif isinstance ( intentsId, types.ListType ) \
                         and any( intent.get( 'id' ) == ids for ids in intentsId ):
-                    intentsDict.append( intent )
+                            intentsDict.append(intent)
 
             if not intentsDict:
                 main.log.info( self.name + ": There is something wrong " +
@@ -2247,10 +2248,10 @@
                 expected = expected.rstrip()
                 main.log.debug( "Expect: {}\nactual: {}".format( expected, actual ) )
                 if actual != expected and 'allocated' in actual and 'allocated' in expected:
-                    marker1 = actual.find( 'allocated' )
-                    m1 = actual[ :marker1 ]
-                    marker2 = expected.find( 'allocated' )
-                    m2 = expected[ :marker2 ]
+                    marker1 = actual.find('allocated')
+                    m1 = actual[:marker1]
+                    marker2 = expected.find('allocated')
+                    m2 = expected[:marker2]
                     if m1 != m2:
                         bandwidthFailed = True
                 elif actual != expected and 'allocated' not in actual and 'allocated' not in expected:
@@ -2259,7 +2260,7 @@
             ONOSOutput.close()
 
             if bandwidthFailed:
-                main.log.error( "Bandwidth not allocated correctly using Intents!!" )
+                main.log.error("Bandwidth not allocated correctly using Intents!!")
                 returnValue = main.FALSE
             return returnValue
         except TypeError:
@@ -2337,6 +2338,7 @@
             Returns main.TRUE only if the number of all installed intents are the same as total intents number
             , otherwise, returns main.FALSE.
         """
+
         try:
             cmd = "intents -s -j"
 
@@ -2348,10 +2350,10 @@
 
             # get total and installed number, see if they are match
             allState = response.get( 'all' )
-            if allState.get( 'total' ) == allState.get( 'installed' ):
-                main.log.info( 'Total Intents: {}   Installed Intents: {}'.format( allState.get( 'total' ), allState.get( 'installed' ) ) )
+            if allState.get('total') == allState.get('installed'):
+                main.log.info( 'Total Intents: {}   Installed Intents: {}'.format( allState.get('total'), allState.get('installed') ) )
                 return main.TRUE
-            main.log.info( 'Verified Intents failed Excepte intetnes: {} installed intents: {}'.format( allState.get( 'total' ), allState.get( 'installed' ) ) )
+            main.log.info( 'Verified Intents failed Excepte intetnes: {} installed intents: {}'.format( allState.get('total'), allState.get('installed') ) )
             return main.FALSE
 
         except ( TypeError, ValueError ):
@@ -2413,7 +2415,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def checkFlowCount( self, min=0, timeout=60 ):
+    def checkFlowCount(self, min=0, timeout=60 ):
         count = self.getTotalFlowsNum( timeout=timeout )
         count = int( count ) if count else 0
         return count if ( count > min ) else False
@@ -2433,11 +2435,11 @@
                           parameter is set true, return main.FALSE otherwise.
         """
         try:
-            states = [ "PENDING_ADD", "PENDING_REMOVE", "REMOVED", "FAILED" ]
+            states = ["PENDING_ADD", "PENDING_REMOVE", "REMOVED", "FAILED"]
             checkedStates = []
-            statesCount = [ 0, 0, 0, 0 ]
+            statesCount = [0, 0, 0, 0]
             for s in states:
-                rawFlows = self.flows( state=s, timeout=timeout )
+                rawFlows = self.flows( state=s, timeout = timeout )
                 if rawFlows:
                     # if we didn't get flows or flows function return None, we should return
                     # main.Flase
@@ -2445,19 +2447,19 @@
                 else:
                     return main.FALSE
             for i in range( len( states ) ):
-                for c in checkedStates[ i ]:
+                for c in checkedStates[i]:
                     try:
-                        statesCount[ i ] += int( c.get( "flowCount" ) )
+                        statesCount[i] += int( c.get( "flowCount" ) )
                     except TypeError:
                         main.log.exception( "Json object not as expected" )
-                main.log.info( states[ i ] + " flows: " + str( statesCount[ i ] ) )
+                main.log.info( states[i] + " flows: " + str( statesCount[i] ) )
 
             # We want to count PENDING_ADD if isPENDING is true
             if isPENDING:
-                if statesCount[ 1 ] + statesCount[ 2 ] + statesCount[ 3 ] > 0:
+                if statesCount[1] + statesCount[2] + statesCount[3] > 0:
                     return main.FALSE
             else:
-                if statesCount[ 0 ] + statesCount[ 1 ] + statesCount[ 2 ] + statesCount[ 3 ] > 0:
+                if statesCount[0] + statesCount[1] + statesCount[2] + statesCount[3] > 0:
                     return main.FALSE
             return main.TRUE
         except ( TypeError, ValueError ):
@@ -2479,7 +2481,7 @@
             main.cleanAndExit()
 
     def pushTestIntents( self, ingress, egress, batchSize, offset="",
-                         options="", timeout=10, background=False, noExit=False, getResponse=False ):
+                         options="", timeout=10, background = False, noExit=False, getResponse=False ):
         """
         Description:
             Push a number of intents in a batch format to
@@ -2546,17 +2548,18 @@
             The number of ADDED flows
             Or return None if any exceptions
         """
+
         try:
             # get total added flows number
             cmd = "flows -c added"
             rawFlows = self.sendline( cmd, timeout=timeout, noExit=noExit )
             if rawFlows:
-                rawFlows = rawFlows.split( "\n" )
+                rawFlows = rawFlows.split("\n")
                 totalFlows = 0
                 for l in rawFlows:
-                    totalFlows += int( l.split( "Count=" )[ 1 ] )
+                    totalFlows += int(l.split("Count=")[1])
             else:
-                main.log.error( "Response not as expected!" )
+                main.log.error("Response not as expected!")
                 return None
             return totalFlows
 
@@ -2578,7 +2581,7 @@
                 main.cleanAndExit()
             return None
 
-    def getTotalIntentsNum( self, timeout=60, noExit=False ):
+    def getTotalIntentsNum( self, timeout=60, noExit = False ):
         """
         Description:
             Get the total number of intents, include every states.
@@ -2593,7 +2596,7 @@
             if response is None:
                 return -1
             response = json.loads( response )
-            return int( response.get( "intents" ) )
+            return int( response.get("intents") )
         except ( TypeError, ValueError ):
             main.log.exception( "{}: Object not as expected: {!r}".format( self.name, response ) )
             return None
@@ -2687,7 +2690,7 @@
         """
         try:
             # Obtain output of intents function
-            intentsStr = self.intents( jsonFormat=True )
+            intentsStr = self.intents(jsonFormat=True)
             if intentsStr is None:
                 raise TypeError
             # Convert to a dictionary
@@ -2797,7 +2800,7 @@
                 main.log.info( "There are no nodes to get id from" )
                 return idList
             nodesJson = json.loads( nodesStr )
-            idList = [ node.get( 'id' ) for node in nodesJson ]
+            idList = [ node.get('id') for node in nodesJson ]
             return idList
         except ( TypeError, ValueError ):
             main.log.exception( "{}: Object not as expected: {!r}".format( self.name, nodesStr ) )
@@ -2849,7 +2852,7 @@
         import json
         try:
             # either onos:topology or 'topology' will work in CLI
-            topology = json.loads( topologyOutput )
+            topology = json.loads(topologyOutput)
             main.log.debug( topology )
             return topology
         except ( TypeError, ValueError ):
@@ -2863,7 +2866,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def checkStatus( self, numoswitch, numolink, numoctrl=-1, logLevel="info" ):
+    def checkStatus(self, numoswitch, numolink, numoctrl = -1, logLevel="info"):
         """
         Checks the number of switches & links that ONOS sees against the
         supplied values. By default this will report to main.log, but the
@@ -3222,7 +3225,7 @@
         Returns a dictionary containing the current intent states and the count
         """
         try:
-            intents = self.intents()
+            intents = self.intents( )
             states = []
             for intent in json.loads( intents ):
                 states.append( intent.get( 'state', None ) )
@@ -3298,7 +3301,7 @@
 
     def specificLeaderCandidate( self, topic ):
         """
-        Returns a list in format [ leader,candidate1,candidate2,... ] for a given
+        Returns a list in format [leader,candidate1,candidate2,...] for a given
         topic parameter and an empty list if the topic doesn't exist
         If no leader is elected leader in the returned list will be "none"
         Returns None if there is a type error processing the json object
@@ -3311,9 +3314,9 @@
             output = json.loads( rawOutput )
             results = []
             for dict in output:
-                if dict[ "topic" ] == topic:
-                    leader = dict[ "leader" ]
-                    candidates = re.split( ", ", dict[ "candidates" ][ 1:-1 ] )
+                if dict["topic"] == topic:
+                    leader = dict["leader"]
+                    candidates = re.split( ", ", dict["candidates"][1:-1] )
                     results.append( leader )
                     results.extend( candidates )
             return results
@@ -3402,10 +3405,10 @@
         information about installed ONOS applications
         """
         # Sample JSON object
-        # [ { "name":"org.onosproject.openflow","id":0,"version":"1.2.0",
+        # [{"name":"org.onosproject.openflow","id":0,"version":"1.2.0",
         # "description":"ONOS OpenFlow protocol southbound providers",
         # "origin":"ON.Lab","permissions":"[]","featuresRepo":"",
-        # "features":"[onos-openflow]","state":"ACTIVE" } ]
+        # "features":"[onos-openflow]","state":"ACTIVE"}]
         try:
             cmdStr = "onos:apps"
             if summary:
@@ -3452,8 +3455,8 @@
             appsJson = json.loads( output )
             state = None
             for app in appsJson:
-                if appName == app.get( 'name' ):
-                    state = app.get( 'state' )
+                if appName == app.get('name'):
+                    state = app.get('state')
                     break
             if state == "ACTIVE" or state == "INSTALLED":
                 return state
@@ -3505,7 +3508,7 @@
                 # Invalid option
                 main.log.error( "The ONOS app command argument only takes " +
                                 "the values: (activate|deactivate|uninstall)" +
-                                "; was given '" + option + "'" )
+                                "; was given '" + option + "'")
                 return main.FALSE
             cmdStr = "onos:app " + option + " " + appName
             output = self.sendline( cmdStr )
@@ -3563,7 +3566,7 @@
             if status == "INSTALLED":
                 response = self.app( appName, "activate" )
                 if check and response == main.TRUE:
-                    for i in range( 10 ):  # try 10 times then give up
+                    for i in range(10):  # try 10 times then give up
                         status = self.appStatus( appName )
                         if status == "ACTIVE":
                             return main.TRUE
@@ -3616,7 +3619,7 @@
             elif status == "ACTIVE":
                 response = self.app( appName, "deactivate" )
                 if check and response == main.TRUE:
-                    for i in range( 10 ):  # try 10 times then give up
+                    for i in range(10):  # try 10 times then give up
                         status = self.appStatus( appName )
                         if status == "INSTALLED":
                             return main.TRUE
@@ -3665,7 +3668,7 @@
             if status == "INSTALLED":
                 response = self.app( appName, "uninstall" )
                 if check and response == main.TRUE:
-                    for i in range( 10 ):  # try 10 times then give up
+                    for i in range(10):  # try 10 times then give up
                         status = self.appStatus( appName )
                         if status == "UNINSTALLED":
                             return main.TRUE
@@ -3680,7 +3683,7 @@
                                 "currently active." )
                 response = self.app( appName, "uninstall" )
                 if check and response == main.TRUE:
-                    for i in range( 10 ):  # try 10 times then give up
+                    for i in range(10):  # try 10 times then give up
                         status = self.appStatus( appName )
                         if status == "UNINSTALLED":
                             return main.TRUE
@@ -3785,8 +3788,8 @@
                     # there is more than one app with this ID
                     result = main.FALSE
                     # We will log this later in the method
-                elif not current[ 0 ][ 'name' ] == appName:
-                    currentName = current[ 0 ][ 'name' ]
+                elif not current[0][ 'name' ] == appName:
+                    currentName = current[0][ 'name' ]
                     result = main.FALSE
                     main.log.error( "'app-ids' has " + str( currentName ) +
                                     " registered under id:" + str( appID ) +
@@ -3801,12 +3804,12 @@
                 namesList.append( item[ 'name' ] )
             if len( idsList ) != len( set( idsList ) ) or\
                len( namesList ) != len( set( namesList ) ):
-                main.log.error( "'app-ids' has some duplicate entries: \n"
-                                + json.dumps( ids,
-                                              sort_keys=True,
-                                              indent=4,
-                                              separators=( ',', ': ' ) ) )
-                result = main.FALSE
+                    main.log.error( "'app-ids' has some duplicate entries: \n"
+                                    + json.dumps( ids,
+                                                  sort_keys=True,
+                                                  indent=4,
+                                                  separators=( ',', ': ' ) ) )
+                    result = main.FALSE
             return result
         except ( TypeError, ValueError ):
             main.log.exception( "{}: Object not as expected: {!r}".format( self.name, rawJson ) )
@@ -3877,7 +3880,7 @@
             propName - The case sensitive name of the property to be set/unset
         Optional arguments:
             value - The value to set the property to. If None, will unset the
-                    property and revert it to it's default value( if applicable )
+                    property and revert it to it's default value(if applicable)
             check - Boolean, Check whether the option was successfully set this
                     only applies when a value is given.
         returns:
@@ -3977,7 +3980,7 @@
         CLI command to add elements to a distributed set.
         Arguments:
             setName - The name of the set to add to.
-            values - The value( s ) to add to the set, space seperated.
+            values - The value(s) to add to the set, space seperated.
         Example usages:
             setTestAdd( "set1", "a b c" )
             setTestAdd( "set2", "1" )
@@ -3991,9 +3994,9 @@
             output = self.distPrimitivesSend( cmdStr )
             positiveMatch = "\[(.*)\] was added to the set " + str( setName )
             negativeMatch = "\[(.*)\] was already in set " + str( setName )
-            if re.search( positiveMatch, output ):
+            if re.search( positiveMatch, output):
                 return main.TRUE
-            elif re.search( negativeMatch, output ):
+            elif re.search( negativeMatch, output):
                 return main.FALSE
             else:
                 main.log.error( self.name + ": setTestAdd did not" +
@@ -4012,11 +4015,11 @@
         CLI command to remove elements from a distributed set.
         Required arguments:
             setName - The name of the set to remove from.
-            values - The value( s ) to remove from the set, space seperated.
+            values - The value(s) to remove from the set, space seperated.
         Optional arguments:
             clear - Clear all elements from the set
-            retain - Retain only the  given values. ( intersection of the
-                     original set and the given set )
+            retain - Retain only the  given values. (intersection of the
+                     original set and the given set)
         returns:
             main.TRUE on success OR
             main.FALSE if the set was not changed OR
@@ -4076,7 +4079,7 @@
         Required arguments:
             setName - The name of the set to remove from.
         Optional arguments:
-            values - The value( s ) to check if in the set, space seperated.
+            values - The value(s) to check if in the set, space seperated.
         returns:
             main.ERROR on error OR
             A list of elements in the set if no optional arguments are
@@ -4556,8 +4559,8 @@
             None on Error
 
             Example output
-            { 'Key1': { 'oldValue': 'oldTestValue', 'value': 'Testing' },
-              'Key2': { 'value': 'Testing' } }
+            { 'Key1': {'oldValue': 'oldTestValue', 'value': 'Testing'},
+              'Key2': {'value': 'Testing'} }
         """
         try:
             numKeys = str( numKeys )
@@ -4647,10 +4650,10 @@
 
     def setSwController( self, uri, ip, proto="tcp", port="6653", jsonFormat=True ):
         """
-        Descrition: sets the controller( s ) for the specified device
+        Descrition: sets the controller(s) for the specified device
 
         Parameters:
-            Required: uri - String: The uri of the device( switch ).
+            Required: uri - String: The uri of the device(switch).
                       ip - String or List: The ip address of the controller.
                       This parameter can be formed in a couple of different ways.
                         VALID:
@@ -4675,14 +4678,14 @@
                 cmd += " -j"
             cmd += " " + uri
             if isinstance( ip, str ):
-                ip = [ ip ]
+                ip = [ip]
             for item in ip:
                 if ":" in item:
                     sitem = item.split( ":" )
-                    if len( sitem ) == 3:
+                    if len(sitem) == 3:
                         cmd += " " + item
-                    elif "." in sitem[ 1 ]:
-                        cmd += " {}:{}".format( item, port )
+                    elif "." in sitem[1]:
+                        cmd += " {}:{}".format(item, port)
                     else:
                         main.log.error( "Malformed entry: " + item )
                         raise TypeError
@@ -4710,19 +4713,19 @@
             main.cleanAndExit()
 
     def removeDevice( self, device ):
-        """
+        '''
         Description:
-            Remove a device from ONOS by passing the uri of the device( s ).
+            Remove a device from ONOS by passing the uri of the device(s).
         Parameters:
-            device - ( str or list ) the id or uri of the device ex. "of:0000000000000001"
+            device - (str or list) the id or uri of the device ex. "of:0000000000000001"
         Returns:
             Returns main.FALSE if an exception is thrown or an error is present
             in the response. Otherwise, returns main.TRUE.
         NOTE:
             If a host cannot be removed, then this function will return main.FALSE
-        """
+        '''
         try:
-            if isinstance( device, str ):
+            if type( device ) is str:
                 deviceStr = device
                 device = []
                 device.append( deviceStr )
@@ -4751,19 +4754,19 @@
             main.cleanAndExit()
 
     def removeHost( self, host ):
-        """
+        '''
         Description:
-            Remove a host from ONOS by passing the id of the host( s )
+            Remove a host from ONOS by passing the id of the host(s)
         Parameters:
-            hostId - ( str or list ) the id or mac of the host ex. "00:00:00:00:00:01"
+            hostId - (str or list) the id or mac of the host ex. "00:00:00:00:00:01"
         Returns:
             Returns main.FALSE if an exception is thrown or an error is present
             in the response. Otherwise, returns main.TRUE.
         NOTE:
             If a host cannot be removed, then this function will return main.FALSE
-        """
+        '''
         try:
-            if isinstance( host, str ):
+            if type( host ) is str:
                 host = list( host )
 
             for h in host:
@@ -4790,16 +4793,16 @@
             main.cleanAndExit()
 
     def link( self, begin, end, state, timeout=30, showResponse=True ):
-        """
+        '''
         Description:
             Bring link down or up in the null-provider.
         params:
-            begin - ( string ) One end of a device or switch.
-            end - ( string ) the other end of the device or switch
+            begin - (string) One end of a device or switch.
+            end - (string) the other end of the device or switch
         returns:
             main.TRUE if no exceptions were thrown and no Errors are
             present in the resoponse. Otherwise, returns main.FALSE
-        """
+        '''
         try:
             cmd = "null-link null:{} null:{} {}".format( begin, end, state )
             response = self.sendline( cmd, showResponse=showResponse, timeout=timeout )
@@ -4824,18 +4827,18 @@
             main.cleanAndExit()
 
     def portstate( self, dpid, port, state ):
-        """
+        '''
         Description:
              Changes the state of port in an OF switch by means of the
              PORTSTATUS OF messages.
         params:
-            dpid - ( string ) Datapath ID of the device. Ex: 'of:0000000000000102'
-            port - ( string ) target port in the device. Ex: '2'
-            state - ( string ) target state ( enable or disable )
+            dpid - (string) Datapath ID of the device. Ex: 'of:0000000000000102'
+            port - (string) target port in the device. Ex: '2'
+            state - (string) target state (enable or disable)
         returns:
             main.TRUE if no exceptions were thrown and no Errors are
             present in the resoponse. Otherwise, returns main.FALSE
-        """
+        '''
         try:
             state = state.lower()
             assert state == 'enable' or state == 'disable', "Unknown state"
@@ -4898,12 +4901,12 @@
           vertex2: { 'edges': ..., 'name': ..., 'protocol': ... } }
         Each vertex should at least have an 'edges' attribute which describes the
         adjacency information. The value of 'edges' attribute is also represented by
-        a dictionary, which maps each edge ( identified by the neighbor vertex ) to a
+        a dictionary, which maps each edge (identified by the neighbor vertex) to a
         list of attributes.
         An example of the edges dictionary:
         'edges': { vertex2: { 'port': ..., 'weight': ... },
                    vertex3: { 'port': ..., 'weight': ... } }
-        If includeHost == True, all hosts ( and host-switch links ) will be included
+        If includeHost == True, all hosts (and host-switch links) will be included
         in topology data.
         """
         graphDict = {}
@@ -4924,7 +4927,7 @@
                 assert idToDevice[ nodeA ][ 'available' ] and idToDevice[ nodeB ][ 'available' ]
                 if nodeA not in graphDict.keys():
                     graphDict[ nodeA ] = { 'edges': {},
-                                           'dpid': idToDevice[ nodeA ][ 'id' ][ 3: ],
+                                           'dpid': idToDevice[ nodeA ][ 'id' ][3:],
                                            'type': idToDevice[ nodeA ][ 'type' ],
                                            'available': idToDevice[ nodeA ][ 'available' ],
                                            'role': idToDevice[ nodeA ][ 'role' ],
@@ -4933,7 +4936,7 @@
                                            'sw': idToDevice[ nodeA ][ 'sw' ],
                                            'serial': idToDevice[ nodeA ][ 'serial' ],
                                            'chassisId': idToDevice[ nodeA ][ 'chassisId' ],
-                                           'annotations': idToDevice[ nodeA ][ 'annotations' ] }
+                                           'annotations': idToDevice[ nodeA ][ 'annotations' ]}
                 else:
                     # Assert nodeB is not connected to any current links of nodeA
                     assert nodeB not in graphDict[ nodeA ][ 'edges' ].keys()
@@ -4959,11 +4962,11 @@
             return None
 
     def getIntentPerfSummary( self ):
-        """
+        '''
         Send command to check intent-perf summary
         Returns: dictionary for intent-perf summary
                  if something wrong, function will return None
-        """
+        '''
         cmd = "intent-perf -s"
         respDic = {}
         resp = self.sendline( cmd )
@@ -4975,9 +4978,9 @@
                 # Delete any white space in line
                 temp = re.sub( r'\s+', '', l )
                 temp = temp.split( ":" )
-                respDic[ temp[ 0 ] ] = temp[ 1 ]
+                respDic[ temp[0] ] = temp[ 1 ]
 
-        except ( TypeError, ValueError ):
+        except (TypeError, ValueError):
             main.log.exception( self.name + ": Object not as expected" )
             return None
         except KeyError:
@@ -5019,7 +5022,7 @@
                 total: return how many lines in karaf log
         """
         try:
-            assert isinstance( searchTerm, str )
+            assert type( searchTerm ) is str
             # Build the log paths string
             logPath = '/opt/onos/log/karaf.log.'
             logPaths = '/opt/onos/log/karaf.log'
@@ -5041,14 +5044,14 @@
                 return num
             elif mode == 'total':
                 totalLines = self.sendline( "cat /opt/onos/log/karaf.log | wc -l" )
-                return int( totalLines )
+                return int(totalLines)
             else:
                 main.log.error( self.name + " unsupported mode" )
                 return main.ERROR
             before = self.sendline( cmd )
             before = before.splitlines()
             # make sure the returned list only contains the search term
-            returnLines = [ line for line in before if searchTerm in line ]
+            returnLines = [line for line in before if searchTerm in line]
             return returnLines
         except AssertionError:
             main.log.error( self.name + " searchTerm is not string type" )
@@ -5094,7 +5097,7 @@
             main.log.error( self.name + ":    " + self.handle.before )
             main.cleanAndExit()
         except NotImplementedError:
-            main.log.exception( self.name + ": Json output not supported" )
+            main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
@@ -5116,7 +5119,7 @@
             for match in mIter:
                 item = {}
                 item[ 'name' ] = match.group( 'name' )
-                ifaces = match.group( 'interfaces' ).split( ', ' )
+                ifaces = match.group( 'interfaces' ).split( ', ')
                 if ifaces == [ "" ]:
                     ifaces = []
                 item[ 'interfaces' ] = ifaces
@@ -5156,7 +5159,7 @@
             main.log.error( self.name + ":    " + self.handle.before )
             main.cleanAndExit()
         except NotImplementedError:
-            main.log.exception( self.name + ": Json output not supported" )
+            main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
@@ -5388,14 +5391,14 @@
             main.log.error( self.name + ":    " + self.handle.before )
             main.cleanAndExit()
         except NotImplementedError:
-            main.log.exception( self.name + ": Json output not supported" )
+            main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
     def getTimeStampFromLog( self, mode, searchTerm, splitTerm_before, splitTerm_after, startLine='', logNum=1 ):
-        """
+        '''
         Get the timestamp of searchTerm from karaf log.
 
         Arguments:
@@ -5408,17 +5411,17 @@
 
             others:
                 Please look at the "logsearch" Function in onosclidriver.py
-        """
+        '''
         if logNum < 0:
-            main.log.error( "Get wrong log number " )
+            main.log.error("Get wrong log number ")
             return main.ERROR
         lines = self.logSearch( mode=mode, searchTerm=searchTerm, startLine=startLine, logNum=logNum )
-        if len( lines ) == 0:
+        if len(lines) == 0:
             main.log.warn( "Captured timestamp string is empty" )
             return main.ERROR
         lines = lines[ 0 ]
         try:
-            assert isinstance( lines, str )
+            assert type(lines) is str
             # get the target value
             line = lines.split( splitTerm_before )
             key = line[ 1 ].split( splitTerm_after )
@@ -5586,7 +5589,7 @@
                 return None
             else:
                 match = re.search( pattern, output )
-                return match.group( 0 )
+                return match.group(0)
         except ( AttributeError, TypeError ):
             main.log.exception( self.name + ": Object not as expected; " + str( output ) )
             return None
@@ -5619,7 +5622,7 @@
                 return None
             else:
                 match = re.search( pattern, output )
-                return match.group( 0 )
+                return match.group(0)
         except ( AttributeError, TypeError ):
             main.log.exception( self.name + ": Object not as expected; " + str( output ) )
             return None
@@ -5652,7 +5655,7 @@
                 return None
             else:
                 match = re.search( pattern, output )
-                return match.group( 0 )
+                return match.group(0)
         except ( AttributeError, TypeError ):
             main.log.exception( self.name + ": Object not as expected; " + str( output ) )
             return None
@@ -5706,4 +5709,4 @@
             main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanAndExit()
+            main.cleanAndExit()
\ No newline at end of file
diff --git a/TestON/drivers/common/cli/onosclusterdriver.py b/TestON/drivers/common/cli/onosclusterdriver.py
old mode 100644
new mode 100755
index cc32b94..5093cfe
--- a/TestON/drivers/common/cli/onosclusterdriver.py
+++ b/TestON/drivers/common/cli/onosclusterdriver.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 """
-Copyright 2017 Open Networking Foundation ( ONF )
+Copyright 2017 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -9,7 +9,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -33,15 +33,11 @@
 from drivers.common.clidriver import CLI
 
 # FIXME: Move this to it's own file?
-
-
 class Controller():
-
     def __str__( self ):
         return self.name
-
     def __repr__( self ):
-        # TODO: use repr() for components?
+        #TODO use repr() for components?
         return "%s<IP=%s, CLI=%s, REST=%s, Bench=%s >" % ( self.name,
                                                            self.ipAddress,
                                                            self.CLI,
@@ -51,9 +47,9 @@
     def __getattr__( self, name ):
         """
         Called when an attribute lookup has not found the attribute
-        in the usual places ( i.e. it is not an instance attribute nor
-        is it found in the class tree for self ). name is the attribute
-        name. This method should return the ( computed ) attribute value
+        in the usual places (i.e. it is not an instance attribute nor
+        is it found in the class tree for self). name is the attribute
+        name. This method should return the (computed) attribute value
         or raise an AttributeError exception.
 
         We will look into each of the node's component handles to try to find the attreibute, looking at REST first
@@ -63,26 +59,28 @@
             main.log.warn( "Rest driver has attribute '%s'" % ( name ) )
             if not usedDriver:
                 usedDriver = True
-                main.log.debug( "Using Rest driver's attribute for '%s'" % ( name ) )
-                f = getattr( self.REST, name )
+                main.log.debug("Using Rest driver's attribute for '%s'" % (name))
+                f = getattr( self.REST, name)
         if hasattr( self.CLI, name ):
             main.log.warn( "CLI driver has attribute '%s'" % ( name ) )
             if not usedDriver:
                 usedDriver = True
-                main.log.debug( "Using CLI driver's attribute for '%s'" % ( name ) )
-                f = getattr( self.CLI, name )
+                main.log.debug("Using CLI driver's attribute for '%s'" % (name))
+                f = getattr( self.CLI, name)
         if hasattr( self.Bench, name ):
             main.log.warn( "Bench driver has attribute '%s'" % ( name ) )
             if not usedDriver:
                 usedDriver = True
-                main.log.debug( "Using Bench driver's attribute for '%s'" % ( name ) )
-                f = getattr( self.Bench, name )
+                main.log.debug("Using Bench driver's attribute for '%s'" % (name))
+                f = getattr( self.Bench, name)
         if usedDriver:
             return f
         raise AttributeError( "Could not find the attribute %s in %r or it's component handles" % ( name, self ) )
 
+
+
     def __init__( self, name, ipAddress, CLI=None, REST=None, Bench=None, pos=None, userName=None, server=None ):
-        # TODO: validate these arguments
+        #TODO: validate these arguments
         self.name = str( name )
         self.ipAddress = ipAddress
         self.CLI = CLI
@@ -94,7 +92,6 @@
         self.user_name = userName
         self.server = server
 
-
 class OnosClusterDriver( CLI ):
 
     def __init__( self ):
@@ -134,9 +131,9 @@
                 elif key == "cluster_name":
                     prefix = self.options[ key ]
 
-            self.home = self.checkOptions( self.home, "~/onos" )
-            self.karafUser = self.checkOptions( self.karafUser, self.user_name )
-            self.karafPass = self.checkOptions( self.karafPass, self.pwd )
+            self.home = self.checkOptions(self.home, "~/onos")
+            self.karafUser = self.checkOptions(self.karafUser, self.user_name)
+            self.karafPass = self.checkOptions(self.karafPass, self.pwd )
             prefix = self.checkOptions( prefix, "ONOS" )
 
             self.name = self.options[ 'name' ]
@@ -249,13 +246,13 @@
         """
         Parse the cluster options to create an ONOS cli component with the given name
         """
-        main.componentDictionary[ name ] = main.componentDictionary[ self.name ].copy()
+        main.componentDictionary[name] = main.componentDictionary[self.name].copy()
         clihost = main.componentDictionary[ name ][ 'COMPONENTS' ].get( "diff_clihost", "" )
         if clihost == "True":
             main.componentDictionary[ name ][ 'host' ] = host
-        main.componentDictionary[ name ][ 'type' ] = "OnosCliDriver"
-        main.componentDictionary[ name ][ 'connect_order' ] = str( int( main.componentDictionary[ name ][ 'connect_order' ] ) + 1 )
-        main.log.debug( main.componentDictionary[ name ] )
+        main.componentDictionary[name]['type'] = "OnosCliDriver"
+        main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
+        main.log.debug( main.componentDictionary[name] )
 
     def createCliComponent( self, name, host ):
         """
@@ -289,18 +286,18 @@
         """
         Parse the cluster options to create an ONOS cli component with the given name
         """
-        main.componentDictionary[ name ] = main.componentDictionary[ self.name ].copy()
-        main.log.debug( main.componentDictionary[ name ] )
-        user = main.componentDictionary[ name ][ 'COMPONENTS' ].get( "web_user", "onos" )
-        main.componentDictionary[ name ][ 'user' ] = self.checkOptions( user, "onos" )
-        password = main.componentDictionary[ name ][ 'COMPONENTS' ].get( "web_pass", "rocks" )
-        main.componentDictionary[ name ][ 'pass' ] = self.checkOptions( password, "rocks" )
-        main.componentDictionary[ name ][ 'host' ] = host
-        port = main.componentDictionary[ name ][ 'COMPONENTS' ].get( "rest_port", "8181" )
-        main.componentDictionary[ name ][ 'port' ] = self.checkOptions( port, "8181" )
-        main.componentDictionary[ name ][ 'type' ] = "OnosRestDriver"
-        main.componentDictionary[ name ][ 'connect_order' ] = str( int( main.componentDictionary[ name ][ 'connect_order' ] ) + 1 )
-        main.log.debug( main.componentDictionary[ name ] )
+        main.componentDictionary[name] = main.componentDictionary[self.name].copy()
+        main.log.debug( main.componentDictionary[name] )
+        user = main.componentDictionary[name]['COMPONENTS'].get( "web_user", "onos" )
+        main.componentDictionary[name]['user'] = self.checkOptions( user, "onos" )
+        password = main.componentDictionary[name]['COMPONENTS'].get( "web_pass", "rocks" )
+        main.componentDictionary[name]['pass'] = self.checkOptions( password, "rocks" )
+        main.componentDictionary[name]['host'] = host
+        port = main.componentDictionary[name]['COMPONENTS'].get( "rest_port", "8181" )
+        main.componentDictionary[name]['port'] = self.checkOptions( port, "8181" )
+        main.componentDictionary[name]['type'] = "OnosRestDriver"
+        main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
+        main.log.debug( main.componentDictionary[name] )
 
     def createRestComponent( self, name, ipAddress ):
         """
@@ -334,12 +331,12 @@
         """
         Parse the cluster options to create an ONOS "bench" component with the given name
         """
-        main.componentDictionary[ name ] = main.componentDictionary[ self.name ].copy()
-        main.componentDictionary[ name ][ 'type' ] = "OnosDriver"
-        home = main.componentDictionary[ name ][ 'COMPONENTS' ].get( "onos_home", None )
-        main.componentDictionary[ name ][ 'home' ] = self.checkOptions( home, None )
-        main.componentDictionary[ name ][ 'connect_order' ] = str( int( main.componentDictionary[ name ][ 'connect_order' ] ) + 1 )
-        main.log.debug( main.componentDictionary[ name ] )
+        main.componentDictionary[name] = main.componentDictionary[self.name].copy()
+        main.componentDictionary[name]['type'] = "OnosDriver"
+        home = main.componentDictionary[name]['COMPONENTS'].get( "onos_home", None )
+        main.componentDictionary[name]['home'] = self.checkOptions( home, None )
+        main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
+        main.log.debug( main.componentDictionary[name] )
 
     def createBenchComponent( self, name ):
         """
@@ -369,6 +366,7 @@
             main.log.error( name + " component already exists!" )
             main.cleanAndExit()
 
+
     def setServerOptions( self, name, ipAddress ):
         """
         Parse the cluster options to create an ONOS "server" component with the given name
@@ -385,6 +383,7 @@
         main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
         main.log.debug( main.componentDictionary[name] )
 
+
     def createServerComponent( self, name, ipAddress ):
         """
         Creates a new onos "server" component. This will be connected to the
@@ -415,6 +414,7 @@
             main.log.error( name + " component already exists!" )
             main.cleanAndExit()
 
+
     def createComponents( self, prefix='', createServer=True ):
         """
         Creates a CLI and REST component for each nodes in the cluster
@@ -425,7 +425,7 @@
         benchPrefix = prefix + "bench"
         serverPrefix = prefix + "server"
         for i in xrange( 1, self.maxNodes + 1 ):
-            cliName = cliPrefix + str( i )
+            cliName = cliPrefix + str( i  )
             restName = restPrefix + str( i )
             benchName = benchPrefix + str( i )
             serverName = serverPrefix + str( i )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
old mode 100644
new mode 100755
index dadc78d..eed4057
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -30,7 +30,6 @@
 from requests.models import Response
 from drivers.common.clidriver import CLI
 
-
 class OnosDriver( CLI ):
 
     def __init__( self ):
@@ -73,9 +72,10 @@
                     break
                 self.maxNodes = None
 
-            if self.maxNodes is None or self.maxNodes == "":
+            if self.maxNodes == None or self.maxNodes == "":
                 self.maxNodes = 100
 
+
             # Grabs all OC environment variables based on max number of nodes
             self.onosIps = {}  # Dictionary of all possible ONOS ip
 
@@ -110,7 +110,7 @@
                 main.log.error( "Uncaught exception: " + str( inst ) )
 
             try:
-                if os.getenv( str( self.ip_address ) ) is not None:
+                if os.getenv( str( self.ip_address ) ) != None:
                     self.ip_address = os.getenv( str( self.ip_address ) )
                 else:
                     main.log.info( self.name +
@@ -172,7 +172,7 @@
         Returns milliseconds since epoch
 
         When checking multiple nodes in a for loop,
-        around a hundred milliseconds of difference ( ascending ) is
+        around a hundred milliseconds of difference (ascending) is
         generally acceptable due to calltime of the function.
         Few seconds, however, is not and it means clocks
         are off sync.
@@ -213,7 +213,7 @@
                     ret = main.FALSE
                     continue  # expect again
                 elif i == 2:
-                    # File( s ) not found
+                    # File(s) not found
                     main.log.error( "onos-package could not find a file or directory" )
                     ret = main.FALSE
                     continue  # expect again
@@ -305,7 +305,7 @@
                     'Runtime\sEnvironment\sto\scontinue',
                     'BUILD\sFAILURE',
                     'BUILD\sSUCCESS',
-                    'onos' + self.prompt,  # TODO: fix this to be more generic?
+                    'onos' + self.prompt,  #TODO: fix this to be more generic?
                     'ONOS' + self.prompt,
                     pexpect.TIMEOUT ], mciTimeout )
                 if i == 0:
@@ -417,7 +417,7 @@
             self.handle.expect( self.prompt )
             cmd = "git pull"
             if comp1 != "":
-                cmd += ' ' + comp1
+                cmd += ' ' +  comp1
             if fastForward:
                 cmd += ' ' + " --ff-only"
             self.handle.sendline( cmd )
@@ -498,7 +498,7 @@
                     self.handle.expect( self.prompt )
                     return main.ERROR
                 except Exception:
-                    main.log.exception( "Couldn't exit editor prompt!" )
+                    main.log.exception( "Couldn't exit editor prompt!")
 
                     main.cleanAndExit()
             elif i == 10:  # In the middle of a merge commit
@@ -652,11 +652,11 @@
             self.handle.sendline( "git name-rev --name-only HEAD" )
             self.handle.expect( "git name-rev --name-only HEAD" )
             self.handle.expect( self.prompt )
-            lines = self.handle.before.splitlines()
-            if lines[ 1 ] == "master" or re.search( "^onos-\d+(\.\d+)+$", lines[ 1 ] ):
-                return lines[ 1 ]
+            lines =  self.handle.before.splitlines()
+            if lines[1] == "master" or re.search( "^onos-\d+(\.\d+)+$", lines[1] ):
+                return lines[1]
             else:
-                main.log.info( lines[ 1 ] )
+                main.log.info( lines[1] )
                 return "unexpected ONOS branch"
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -702,11 +702,11 @@
                     # as xml specific tags that cause errors
                     line = line.replace( "<", "[" )
                     line = line.replace( ">", "]" )
-                    # main.log.wiki( "\t" + line )
+                    #main.log.wiki( "\t" + line )
                     main.log.wiki( line + "<br /> " )
                     main.log.summary( line )
                 main.log.wiki( "</blockquote>" )
-                main.log.summary( "\n" )
+                main.log.summary("\n")
             return lines[ 2 ]
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -733,7 +733,7 @@
                   supported currently
             * ONOS IP addresses ( onosIpAddrs )
                 - Must be passed in as last arguments
-            * ONOS USER ( onosUser )
+            * ONOS USER (onosUser)
                 - optional argument to set ONOS_USER environment variable
 
         NOTE: Assumes cells are located at:
@@ -837,14 +837,14 @@
                 handleAfter = self.handle.after
                 # Get the rest of the handle
                 self.handle.expect( self.prompt )
-                time.sleep( 10 )
+                time.sleep(10)
                 handleMore = self.handle.before
 
                 cell_result = handleBefore + handleAfter + handleMore
-                # print cell_result
+                #print cell_result
                 if( re.search( "No such cell", cell_result ) ):
                     main.log.error( "Cell call returned: " + handleBefore +
-                                    handleAfter + handleMore )
+                               handleAfter + handleMore )
 
                     main.cleanAndExit()
                 return main.TRUE
@@ -886,7 +886,7 @@
         Uses 'onos <node-ip> cfg set' to change a parameter value of an
         application.
 
-        ex )
+        ex)
             onos 10.0.0.1 cfg set org.onosproject.myapp appSetting 1
         ONOSIp = '10.0.0.1'
         configName = 'org.onosproject.myapp'
@@ -899,11 +899,11 @@
             self.handle.sendline( "" )
             self.handle.expect( ":~" )
             self.handle.sendline( cfgStr )
-            self.handle.expect( "cfg set" )
+            self.handle.expect("cfg set")
             self.handle.expect( ":~" )
 
-            paramValue = configParam.split( " " )[ 1 ]
-            paramName = configParam.split( " " )[ 0 ]
+            paramValue = configParam.split(" ")[1]
+            paramName = configParam.split(" ")[0]
 
             checkStr = 'onos {} cfg get " {} {} " '.format( ONOSIp, configName, paramName )
 
@@ -911,7 +911,7 @@
             self.handle.expect( ":~" )
 
             if "value=" + paramValue + "," in self.handle.before:
-                main.log.info( "cfg " + configName + " successfully set to " + configParam )
+                main.log.info("cfg " + configName + " successfully set to " + configParam)
                 return main.TRUE
         except pexpect.ExceptionPexpect as e:
             main.log.exception( self.name + ": Pexpect exception found: " )
@@ -967,7 +967,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def onosSecureSSH( self, userName="onos", userPWD="rocks", node="" ):
+    def onosSecureSSH( self, userName="onos", userPWD="rocks", node=""):
         """
         Enables secure access to ONOS console
         by removing default users & keys.
@@ -976,6 +976,7 @@
 
         Returns: main.TRUE on success and main.FALSE on failure
         """
+
         try:
             self.handle.sendline( "" )
             self.handle.expect( self.prompt )
@@ -984,9 +985,9 @@
             # NOTE: this timeout may need to change depending on the network
             # and size of ONOS
             # TODO: Handle the other possible error
-            i = self.handle.expect( [ "Network\sis\sunreachable",
-                                      self.prompt,
-                                      pexpect.TIMEOUT ], timeout=180 )
+            i = self.handle.expect([ "Network\sis\sunreachable",
+                                     self.prompt,
+                                     pexpect.TIMEOUT ], timeout=180 )
             if i == 0:
                 # can't reach ONOS node
                 main.log.warn( "Network is unreachable" )
@@ -995,8 +996,8 @@
             elif i == 1:
                 # Process started
                 main.log.info(
-                    "Secure SSH performed on " +
-                    node )
+                "Secure SSH performed on " +
+                node)
                 return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1006,6 +1007,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+
     def onosInstall( self, options="-f", node="" ):
         """
         Installs ONOS bits on the designated cell machine.
@@ -1327,7 +1329,7 @@
     def isup( self, node="", timeout=240 ):
         """
         Run's onos-wait-for-start which only returns once ONOS is at run
-        level 100( ready for use )
+        level 100(ready for use)
 
         Returns: main.TRUE if ONOS is running and main.FALSE on timeout
         """
@@ -1335,7 +1337,7 @@
             self.handle.sendline( "onos-wait-for-start " + node )
             self.handle.expect( "onos-wait-for-start" )
             # NOTE: this timeout is arbitrary"
-            i = self.handle.expect( [ self.prompt, pexpect.TIMEOUT ], timeout )
+            i = self.handle.expect([self.prompt, pexpect.TIMEOUT], timeout)
             if i == 0:
                 main.log.info( self.name + ": " + node + " is up" )
                 return main.TRUE
@@ -1374,6 +1376,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+
     def pushTestIntentsShell(
             self,
             dpidSrc,
@@ -1515,7 +1518,7 @@
             self.handle.expect( self.prompt )
             self.handle.sendline( "" )
             if grepOptions:
-                grepStr = "grep " + str( grepOptions )
+                grepStr = "grep "+str(grepOptions)
             else:
                 grepStr = "grep"
 
@@ -1524,12 +1527,12 @@
                 str( interface ) +
                 " -t e | " +
                 grepStr + " --line-buffered \"" +
-                str( grep ) +
+                str(grep) +
                 "\" >" +
                 directory +
                 " &" )
-            self.handle.sendline( cmd )
-            main.log.info( cmd )
+            self.handle.sendline(cmd)
+            main.log.info(cmd)
             self.handle.expect( "Capturing on" )
             self.handle.sendline( "\n" )
             self.handle.expect( self.prompt )
@@ -1597,7 +1600,7 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def dumpONOSCmd( self, ONOSIp, CMD, destDir, filename, options="" ):
+    def dumpONOSCmd(self, ONOSIp, CMD, destDir, filename, options=""):
         """
         Dump Cmd to a desired directory.
         For debugging purposes, you may want to use
@@ -1612,14 +1615,15 @@
             * fileName: Name of the file
             * options: Options for ONOS command
         """
+
         localtime = time.strftime( '%x %X' )
         localtime = localtime.replace( "/", "" )
         localtime = localtime.replace( " ", "_" )
         localtime = localtime.replace( ":", "" )
         if destDir[ -1: ] != "/":
             destDir += "/"
-        cmd = CMD + " " + options + " > " + str( destDir ) + str( filename ) + localtime
-        return self.onosCli( ONOSIp, cmd )
+        cmd=CMD + " " + options + " > " + str( destDir ) + str( filename ) + localtime
+        return self.onosCli(ONOSIp, cmd)
 
     def cpLogsToDir( self, logToCopy,
                      destDir, copyFileName="" ):
@@ -1674,7 +1678,7 @@
         except Exception:
             main.log.exception( "Copying files failed" )
 
-    def checkLogs( self, onosIp, restart=False ):
+    def checkLogs( self, onosIp, restart=False):
         """
         runs onos-check-logs on the given onos node
         If restart is True, use the old version of onos-check-logs which
@@ -1737,17 +1741,17 @@
                      direction='INPUT', rule='DROP', states=True ):
         """
         Description:
-            add or remove iptables rule to DROP ( default ) packets from
+            add or remove iptables rule to DROP (default) packets from
             specific IP and PORT
         Usage:
-        * specify action ( 'add' or 'remove' )
+        * specify action ('add' or 'remove')
           when removing, pass in the same argument as you would add. It will
           delete that specific rule.
         * specify the ip to block
-        * specify the destination port to block ( defaults to all ports )
-        * optional packet type to block ( default tcp )
-        * optional iptables rule ( default DROP )
-        * optional direction to block ( default 'INPUT' )
+        * specify the destination port to block (defaults to all ports)
+        * optional packet type to block (default tcp)
+        * optional iptables rule (default DROP)
+        * optional direction to block (default 'INPUT')
         * States boolean toggles adding all supported tcp states to the
           firewall rule
         Returns:
@@ -1758,6 +1762,7 @@
         * This function uses root privilege iptables command which may result
           in unwanted network errors. USE WITH CAUTION
         """
+
         # NOTE*********
         #   The strict checking methods of this driver function is intentional
         #   to discourage any misuse or error of iptables, which can cause
@@ -1799,13 +1804,14 @@
             cmd = "sudo iptables " + actionFlag + " " +\
                   direction +\
                   " -s " + str( ip )
+                  # " -p " + str( packet_type ) +\
             if packet_type:
                 cmd += " -p " + str( packet_type )
             if port:
                 cmd += " --dport " + str( port )
             if states:
                 cmd += " -m state --state="
-                # FIXME- Allow user to configure which states to block
+                #FIXME- Allow user to configure which states to block
                 cmd += "INVALID,ESTABLISHED,NEW,RELATED,UNTRACKED"
             cmd += " -j " + str( rule )
 
@@ -1834,10 +1840,10 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def detailed_status( self, log_filename ):
+    def detailed_status(self, log_filename):
         """
         This method is used by STS to check the status of the controller
-        Reports RUNNING, STARTING, STOPPED, FROZEN, ERROR ( and reason )
+        Reports RUNNING, STARTING, STOPPED, FROZEN, ERROR (and reason)
         """
         import re
         try:
@@ -1878,8 +1884,8 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def createLinkGraphFile( self, benchIp, ONOSIpList, deviceCount ):
-        """
+    def createLinkGraphFile( self, benchIp, ONOSIpList, deviceCount):
+        '''
             Create/formats the LinkGraph.cfg file based on arguments
                 -only creates a linear topology and connects islands
                 -evenly distributes devices
@@ -1888,113 +1894,115 @@
                 ONOSIpList - list of all of the node IPs to be used
 
                 deviceCount - number of switches to be assigned
-        """
-        main.log.info( "Creating link graph configuration file." )
+        '''
+        main.log.info("Creating link graph configuration file." )
         linkGraphPath = self.home + "/tools/package/etc/linkGraph.cfg"
         tempFile = "/tmp/linkGraph.cfg"
 
-        linkGraph = open( tempFile, 'w+' )
-        linkGraph.write( "# NullLinkProvider topology description (config file).\n" )
-        linkGraph.write( "# The NodeId is only added if the destination is another node's device.\n" )
-        linkGraph.write( "# Bugs: Comments cannot be appended to a line to be read.\n" )
+        linkGraph = open(tempFile, 'w+')
+        linkGraph.write("# NullLinkProvider topology description (config file).\n")
+        linkGraph.write("# The NodeId is only added if the destination is another node's device.\n")
+        linkGraph.write("# Bugs: Comments cannot be appended to a line to be read.\n")
 
-        clusterCount = len( ONOSIpList )
+        clusterCount = len(ONOSIpList)
 
-        if isinstance( deviceCount, int ) or isinstance( deviceCount, str ):
-            deviceCount = int( deviceCount )
-            switchList = [ 0 ] * ( clusterCount + 1 )
-            baselineSwitchCount = deviceCount / clusterCount
+        if type(deviceCount) is int or type(deviceCount) is str:
+            deviceCount = int(deviceCount)
+            switchList = [0]*(clusterCount+1)
+            baselineSwitchCount = deviceCount/clusterCount
 
-            for node in range( 1, clusterCount + 1 ):
-                switchList[ node ] = baselineSwitchCount
+            for node in range(1, clusterCount + 1):
+                switchList[node] = baselineSwitchCount
 
-            for node in range( 1, ( deviceCount % clusterCount ) + 1 ):
-                switchList[ node ] += 1
+            for node in range(1, (deviceCount%clusterCount)+1):
+                switchList[node] += 1
 
-        if isinstance( deviceCount, list ):
-            main.log.info( "Using provided device distribution" )
-            switchList = [ 0 ]
+        if type(deviceCount) is list:
+            main.log.info("Using provided device distribution")
+            switchList = [0]
             for i in deviceCount:
-                switchList.append( int( i ) )
+                switchList.append(int(i))
 
-        tempList = [ '0' ]
-        tempList.extend( ONOSIpList )
+        tempList = ['0']
+        tempList.extend(ONOSIpList)
         ONOSIpList = tempList
 
         myPort = 6
         lastSwitch = 0
-        for node in range( 1, clusterCount + 1 ):
-            if switchList[ node ] == 0:
+        for node in range(1, clusterCount+1):
+            if switchList[node] == 0:
                 continue
 
-            linkGraph.write( "graph " + ONOSIpList[ node ] + " {\n" )
+            linkGraph.write("graph " + ONOSIpList[node] + " {\n")
 
             if node > 1:
-                # connect to last device on previous node
-                line = ( "\t0:5 -> " + str( lastSwitch ) + ":6:" + lastIp + "\n" )  # ONOSIpList[ node-1 ]
-                linkGraph.write( line )
+                #connect to last device on previous node
+                line = ("\t0:5 -> " + str(lastSwitch) + ":6:" + lastIp + "\n")     #ONOSIpList[node-1]
+                linkGraph.write(line)
 
             lastSwitch = 0
-            for switch in range( 0, switchList[ node ] - 1 ):
+            for switch in range (0, switchList[node]-1):
                 line = ""
-                line = ( "\t" + str( switch ) + ":" + str( myPort ) )
+                line = ("\t" + str(switch) + ":" + str(myPort))
                 line += " -- "
-                line += ( str( switch + 1 ) + ":" + str( myPort - 1 ) + "\n" )
-                linkGraph.write( line )
-                lastSwitch = switch + 1
-            lastIp = ONOSIpList[ node ]
+                line += (str(switch+1) + ":" + str(myPort-1) + "\n")
+                linkGraph.write(line)
+                lastSwitch = switch+1
+            lastIp = ONOSIpList[node]
 
-            # lastSwitch += 1
-            if node < ( clusterCount ):
-                # connect to first device on the next node
-                line = ( "\t" + str( lastSwitch ) + ":6 -> 0:5:" + ONOSIpList[ node + 1 ] + "\n" )
-                linkGraph.write( line )
+            #lastSwitch += 1
+            if node < (clusterCount):
+                #connect to first device on the next node
+                line = ("\t" + str(lastSwitch) + ":6 -> 0:5:" + ONOSIpList[node+1] + "\n")
+                linkGraph.write(line)
 
-            linkGraph.write( "}\n" )
+            linkGraph.write("}\n")
         linkGraph.close()
 
-        # SCP
-        os.system( "scp " + tempFile + " " + self.user_name + "@" + benchIp + ":" + linkGraphPath )
-        main.log.info( "linkGraph.cfg creation complete" )
+        #SCP
+        os.system( "scp " + tempFile + " " + self.user_name + "@" + benchIp + ":" + linkGraphPath)
+        main.log.info("linkGraph.cfg creation complete")
 
-    def configNullDev( self, ONOSIpList, deviceCount, numPorts=10 ):
-        """
+    def configNullDev( self, ONOSIpList, deviceCount, numPorts=10):
+
+        '''
             ONOSIpList = list of Ip addresses of nodes switches will be devided amongst
             deviceCount = number of switches to distribute, or list of values to use as custom distribution
             numPorts = number of ports per device. Defaults to 10 both in this function and in ONOS. Optional arg
-        """
-        main.log.info( "Configuring Null Device Provider" )
-        clusterCount = len( ONOSIpList )
+        '''
+
+        main.log.info("Configuring Null Device Provider" )
+        clusterCount = len(ONOSIpList)
 
         try:
 
-            if isinstance( deviceCount, int ) or isinstance( deviceCount, str ):
-                main.log.info( "Creating device distribution" )
-                deviceCount = int( deviceCount )
-                switchList = [ 0 ] * ( clusterCount + 1 )
-                baselineSwitchCount = deviceCount / clusterCount
+            if type(deviceCount) is int or type(deviceCount) is str:
+                main.log.info("Creating device distribution")
+                deviceCount = int(deviceCount)
+                switchList = [0]*(clusterCount+1)
+                baselineSwitchCount = deviceCount/clusterCount
 
-                for node in range( 1, clusterCount + 1 ):
-                    switchList[ node ] = baselineSwitchCount
+                for node in range(1, clusterCount + 1):
+                    switchList[node] = baselineSwitchCount
 
-                for node in range( 1, ( deviceCount % clusterCount ) + 1 ):
-                    switchList[ node ] += 1
+                for node in range(1, (deviceCount%clusterCount)+1):
+                    switchList[node] += 1
 
-            if isinstance( deviceCount, list ):
-                main.log.info( "Using provided device distribution" )
+            if type(deviceCount) is list:
+                main.log.info("Using provided device distribution")
 
-                if len( deviceCount ) == clusterCount:
-                    switchList = [ '0' ]
-                    switchList.extend( deviceCount )
+                if len(deviceCount) == clusterCount:
+                    switchList = ['0']
+                    switchList.extend(deviceCount)
 
-                if len( deviceCount ) == ( clusterCount + 1 ):
-                    if deviceCount[ 0 ] == '0' or deviceCount[ 0 ] == 0:
+                if len(deviceCount) == (clusterCount + 1):
+                    if deviceCount[0] == '0' or deviceCount[0] == 0:
                         switchList = deviceCount
 
-                assert len( switchList ) == ( clusterCount + 1 )
+                assert len(switchList) == (clusterCount + 1)
 
         except AssertionError:
-            main.log.error( "Bad device/Ip list match" )
+            main.log.error( "Bad device/Ip list match")
         except TypeError:
             main.log.exception( self.name + ": Object not as expected" )
             return None
@@ -2002,76 +2010,80 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-        ONOSIp = [ 0 ]
-        ONOSIp.extend( ONOSIpList )
 
-        devicesString = "devConfigs = "
-        for node in range( 1, len( ONOSIp ) ):
-            devicesString += ( ONOSIp[ node ] + ":" + str( switchList[ node ] ) )
+        ONOSIp = [0]
+        ONOSIp.extend(ONOSIpList)
+
+        devicesString  = "devConfigs = "
+        for node in range(1, len(ONOSIp)):
+            devicesString += (ONOSIp[node] + ":" + str(switchList[node] ))
             if node < clusterCount:
-                devicesString += ( "," )
+                devicesString += (",")
 
         try:
-            self.handle.sendline( "onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider devConfigs " + devicesString )
-            self.handle.expect( ":~" )
-            self.handle.sendline( "onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider numPorts " + str( numPorts ) )
-            self.handle.expect( ":~" )
+            self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider devConfigs " + devicesString )
+            self.handle.expect(":~")
+            self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider numPorts " + str(numPorts) )
+            self.handle.expect(":~")
 
-            for i in range( 10 ):
-                self.handle.sendline( "onos $OC1 cfg get org.onosproject.provider.nil.device.impl.NullDeviceProvider" )
-                self.handle.expect( ":~" )
+            for i in range(10):
+                self.handle.sendline("onos $OC1 cfg get org.onosproject.provider.nil.device.impl.NullDeviceProvider")
+                self.handle.expect(":~")
                 verification = self.handle.before
-                if ( " value=" + str( numPorts ) ) in verification and ( " value=" + devicesString ) in verification:
+                if (" value=" + str(numPorts)) in verification and (" value=" + devicesString) in verification:
                     break
                 else:
-                    time.sleep( 1 )
+                    time.sleep(1)
 
-            assert ( "value=" + str( numPorts ) ) in verification and ( " value=" + devicesString ) in verification
+            assert ("value=" + str(numPorts)) in verification and (" value=" + devicesString) in verification
 
         except AssertionError:
-            main.log.error( "Incorrect Config settings: " + verification )
+            main.log.error("Incorrect Config settings: " + verification)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
-    def configNullLink( self, fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0 ):
-        """
+    def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0):
+        '''
                 fileName default is currently the same as the default on ONOS, specify alternate file if
                 you want to use a different topology file than linkGraph.cfg
-        """
-        try:
-            self.handle.sendline( "onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider eventRate " + str( eventRate ) )
-            self.handle.expect( ":~" )
-            self.handle.sendline( "onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider cfgFile " + fileName )
-            self.handle.expect( ":~" )
+        '''
 
-            for i in range( 10 ):
-                self.handle.sendline( "onos $OC1 cfg get org.onosproject.provider.nil.link.impl.NullLinkProvider" )
-                self.handle.expect( ":~" )
+
+        try:
+            self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider eventRate " + str(eventRate))
+            self.handle.expect(":~")
+            self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider cfgFile " + fileName )
+            self.handle.expect(":~")
+
+            for i in range(10):
+                self.handle.sendline("onos $OC1 cfg get org.onosproject.provider.nil.link.impl.NullLinkProvider")
+                self.handle.expect(":~")
                 verification = self.handle.before
-                if ( " value=" + str( eventRate ) ) in verification and ( " value=" + fileName ) in verification:
+                if (" value=" + str(eventRate)) in verification and (" value=" + fileName) in verification:
                     break
                 else:
-                    time.sleep( 1 )
+                    time.sleep(1)
 
-            assert ( "value=" + str( eventRate ) ) in verification and ( " value=" + fileName ) in verification
+            assert ("value=" + str(eventRate)) in verification and (" value=" + fileName) in verification
 
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
             main.cleanAndExit()
         except AssertionError:
-            main.log.info( "Settings did not post to ONOS" )
-            main.log.error( varification )
+            main.log.info("Settings did not post to ONOS")
+            main.log.error(varification)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.log.error( varification )
+            main.log.error(varification)
             main.cleanAndExit()
 
     def getOnosIps( self ):
         """
             Get all onos IPs stored in
         """
+
         return sorted( self.onosIps.values() )
 
     def listLog( self, nodeIp ):
@@ -2124,16 +2136,16 @@
         """
         try:
             main.log.info( " Log Report for {} ".format( nodeIp ).center( 70, '=' ) )
-            if isinstance( searchTerms, str ):
-                searchTerms = [ searchTerms ]
+            if type( searchTerms ) is str:
+                searchTerms = [searchTerms]
             numTerms = len( searchTerms )
             outputMode = outputMode.lower()
 
             totalHits = 0
             logLines = []
             for termIndex in range( numTerms ):
-                term = searchTerms[ termIndex ]
-                logLines.append( [ term ] )
+                term = searchTerms[termIndex]
+                logLines.append( [term] )
                 if startStr and endStr:
                     cmd = "onos-ssh {} \"sed -n '/{}/,/{}/p' /opt/onos/log/karaf.log | grep {}\"".format( nodeIp,
                                                                                                           startStr,
@@ -2150,7 +2162,7 @@
                     if term in line and "grep" not in line:
                         count += 1
                         if before.index( line ) > ( len( before ) - 7 ):
-                            logLines[ termIndex ].append( line )
+                            logLines[termIndex].append( line )
                 main.log.info( "{}: {}".format( term, count ) )
                 totalHits += count
                 if termIndex == numTerms - 1:
@@ -2158,10 +2170,10 @@
             if outputMode != "s":
                 outputString = ""
                 for term in logLines:
-                    outputString = term[ 0 ] + ": \n"
+                    outputString = term[0] + ": \n"
                     for line in range( 1, len( term ) ):
-                        outputString += ( "\t" + term[ line ] + "\n" )
-                    if outputString != ( term[ 0 ] + ": \n" ):
+                        outputString += ( "\t" + term[line] + "\n" )
+                    if outputString != ( term[0] + ": \n" ):
                         main.log.info( outputString )
             main.log.info( "=" * 70 )
             return totalHits
@@ -2178,7 +2190,7 @@
             main.cleanAndExit()
 
     def copyMininetFile( self, fileName, localPath, userName, ip,
-                         mnPath='~/mininet/custom/', timeout=60 ):
+                         mnPath='~/mininet/custom/', timeout = 60 ):
         """
         Description:
             Copy mininet topology file from dependency folder in the test folder
@@ -2194,6 +2206,7 @@
             Return main.TRUE if successfully copied the file otherwise
             return main.FALSE
         """
+
         try:
             cmd = "scp " + localPath + fileName + " " + userName + "@" + \
                   str( ip ) + ":" + mnPath + fileName
@@ -2230,22 +2243,22 @@
             main.log.error( self.name + ":     " + self.handle.before )
             main.cleanAndExit()
 
-    def jvmSet( self, memory=8 ):
+    def jvmSet(self, memory=8):
 
         import os
 
-        homeDir = os.path.expanduser( '~' )
+        homeDir = os.path.expanduser('~')
         filename = "/onos/tools/package/bin/onos-service"
 
-        serviceConfig = open( homeDir + filename, 'w+' )
-        serviceConfig.write( "#!/bin/bash\n " )
-        serviceConfig.write( "#------------------------------------- \n " )
-        serviceConfig.write( "# Starts ONOS Apache Karaf container\n " )
-        serviceConfig.write( "#------------------------------------- \n " )
-        serviceConfig.write( "#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n " )
-        serviceConfig.write( """export JAVA_OPTS="${ JAVA_OPTS:--Xms""" + str(memory) + "G -Xmx" + str(memory) + """G }" \n """ )
-        serviceConfig.write( "[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n" )
-        serviceConfig.write( """${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """ )
+        serviceConfig = open(homeDir + filename, 'w+')
+        serviceConfig.write("#!/bin/bash\n ")
+        serviceConfig.write("#------------------------------------- \n ")
+        serviceConfig.write("# Starts ONOS Apache Karaf container\n ")
+        serviceConfig.write("#------------------------------------- \n ")
+        serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ")
+        serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms""" + str(memory) + "G -Xmx" + str(memory) + """G}" \n """)
+        serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n")
+        serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """)
         serviceConfig.close()
 
     def createDBFile( self, testData ):
@@ -2254,7 +2267,7 @@
         DBString = ""
 
         for item in testData:
-            if isinstance( item, string ):
+            if type( item ) is string:
                 item = "'" + item + "'"
             if testData.index( item ) < len( testData - 1 ):
                 item += ","
@@ -2266,15 +2279,15 @@
 
     def verifySummary( self, ONOSIp, *deviceCount ):
 
-        self.handle.sendline( "onos " + ONOSIp + " summary" )
+        self.handle.sendline( "onos " + ONOSIp  + " summary" )
         self.handle.expect( ":~" )
 
         summaryStr = self.handle.before
         print "\nSummary\n==============\n" + summaryStr + "\n\n"
 
-        # passed = "SCC(s)=1" in summaryStr
-        # if deviceCount:
-        #    passed = "devices=" + str( deviceCount ) + "," not in summaryStr
+        #passed = "SCC(s)=1" in summaryStr
+        #if deviceCount:
+        #    passed = "devices=" + str(deviceCount) + "," not in summaryStr
 
         passed = False
         if "SCC(s)=1," in summaryStr:
@@ -2285,7 +2298,7 @@
 
         if deviceCount:
             print" ============================="
-            checkStr = "devices=" + str( deviceCount[ 0 ] ) + ","
+            checkStr = "devices=" + str( deviceCount[0] ) + ","
             print "Checkstr: " + checkStr
             if checkStr not in summaryStr:
                 passed = False
@@ -2317,7 +2330,7 @@
             # IF self.ip_address is an ip address and matches
             #    self.nicAddr: return self.ip_address
             if match:
-                curIp = match.group( 0 )
+                curIp = match.group(0)
                 if nicPat:
                     nicMatch = re.search( nicPat, curIp )
                     if nicMatch:
@@ -2332,7 +2345,7 @@
             ips = re.findall( ifPat, raw )
             if iface:
                 if ips:
-                    ip = ips[ 0 ]
+                    ip = ips[0]
                     self.ip_address = ip
                     return ip
                 else:
@@ -2346,8 +2359,8 @@
                         return ip
             else:  # If only one non-localhost ip, return that
                 tmpList = [ ip for ip in ips if ip is not LOCALHOST ]
-                if len( tmpList ) == 1:
-                    curIp = tmpList[ 0 ]
+                if len(tmpList) == 1:
+                    curIp = tmpList[0]
                     self.ip_address = curIp
                     return curIp
             # Either no non-localhost IPs, or more than 1
@@ -2361,9 +2374,9 @@
             main.log.exception( "Uncaught exception" )
 
     def startBasicONOS( self, nodeList, opSleep=60, onosStartupSleep=30, onosUser="sdn" ):
-        """
+        '''
         Start onos cluster with defined nodes, but only with drivers app
-        """
+        '''
         import time
 
         self.createCellFile( self.ip_address,
@@ -2396,8 +2409,8 @@
 
         onosStatus = True
         for nd in nodeList:
-            onosStatus = onosStatus & self.isup( node=nd )
-            # print "onosStatus is: " + str( onosStatus )
+            onosStatus = onosStatus & self.isup( node = nd )
+            #print "onosStatus is: " + str( onosStatus )
 
         return main.TRUE if onosStatus else main.FALSE
 
diff --git a/TestON/drivers/common/cli/ovsdbdriver.py b/TestON/drivers/common/cli/ovsdbdriver.py
index 7c2a43d..636a7b2 100644
--- a/TestON/drivers/common/cli/ovsdbdriver.py
+++ b/TestON/drivers/common/cli/ovsdbdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 """
-Copyright 2015 Open Networking Foundation ( ONF )
+Copyright 2015 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,6 +21,7 @@
     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 
 """
+
 """
 drivers for ovsdb commands.
 
@@ -50,11 +51,11 @@
     def connect( self, **connectargs ):
         try:
             for key in connectargs:
-                vars( self )[ key ] = connectargs[ key ]
+                vars( self)[ key ] = connectargs[ key ]
 
             self.name = self.options[ 'name' ]
-            if os.getenv( str( self.ip_address ) ) is not None:
-                self.ip_address = os.getenv( str( self.ip_address ) )
+            if os.getenv( str( self.ip_address ) ) != None:
+                self.ip_address = os.getenv(str ( self.ip_address ) )
             else:
                 main.log.info( self.name + ": Trying to connect to " +
                                self.ip_address )
@@ -62,7 +63,7 @@
                     user_name=self.user_name,
                     ip_address=self.ip_address,
                     port=self.port,
-                    pwd=self.pwd )
+                    pwd=self.pwd)
 
             if self.handle:
                 main.log.info( "Connection successful to the ovsdb node " +
@@ -90,7 +91,7 @@
         return response
 
     def setManager( self, ip, port, delaytime="5" ):
-        command = "sudo ovs-vsctl set-manager tcp:" + str( ip ) + ":" + str( port )
+        command= "sudo ovs-vsctl set-manager tcp:" + str( ip ) + ":" + str( port )
         try:
             handle = self.execute(
                 cmd=command,
@@ -101,7 +102,7 @@
                 return main.FALSE
             else:
                 main.log.info( "Ovsdb manager " + str( ip ) + " set" )
-                # delay time  for ovsdb connection create
+                #delay time  for ovsdb connection create
                 main.log.info( "Wait " + str( delaytime ) + " seconds for ovsdb connection create" )
                 time.sleep( int( delaytime ) )
                 return main.TRUE
@@ -111,7 +112,7 @@
             main.cleanAndExit()
 
     def delManager( self, delaytime="5" ):
-        command = "sudo ovs-vsctl del-manager"
+        command= "sudo ovs-vsctl del-manager"
         try:
             handle = self.execute(
                 cmd=command,
@@ -122,7 +123,7 @@
                 return main.FALSE
             else:
                 main.log.info( "Ovsdb manager delete" )
-                # delay time  for ovsdb connection delete
+                #delay time  for ovsdb connection delete
                 main.log.info( "Wait " + str( delaytime ) + " seconds for ovsdb connection delete" )
                 time.sleep( int( delaytime ) )
                 return main.TRUE
@@ -132,7 +133,7 @@
             main.cleanAndExit()
 
     def getManager( self ):
-        command = "sudo ovs-vsctl get-manager"
+        command= "sudo ovs-vsctl get-manager"
         try:
             response = self.execute(
                 cmd=command,
@@ -151,7 +152,7 @@
             The output of the command from the linux
             or main.FALSE on timeout
         """
-        command = "sudo ovs-vsctl list-br"
+        command= "sudo ovs-vsctl list-br"
         try:
             response = self.execute(
                 cmd=command,
@@ -173,7 +174,7 @@
             The output of the command from the linux
             or main.FALSE on timeout
         """
-        command = "sudo ovs-vsctl list-ports " + str( sw )
+        command= "sudo ovs-vsctl list-ports " + str( sw )
         try:
             response = self.execute(
                 cmd=command,
@@ -198,7 +199,7 @@
         try:
             response = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if response:
                 return response
             else:
@@ -219,7 +220,7 @@
         try:
             response = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if response:
                 return response
             else:
@@ -250,8 +251,8 @@
             else:
                 return main.FALSE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
     def createHost( self, hostname ):
@@ -259,7 +260,7 @@
         try:
             handle = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if re.search( "Error", handle ):
                 main.log.error( "Error in create host" + str( hostname ) )
                 main.log.error( handle )
@@ -268,20 +269,20 @@
                 main.log.info( "Create " + str( hostname ) + " sucess" )
                 return main.TRUE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
-    def createHostport( self, hostname="host1", hostport="host1-eth0", ovsport="port1", hostportmac="000000000001" ):
-        command = "sudo ip link add " + str( hostport ) + " type veth peer name " + str( ovsport )
-        command += ";" + "sudo ip link set " + str( hostport ) + " up"
-        command += ";" + "sudo ip link set " + str( ovsport ) + " up"
-        command += ";" + " sudo ifconfig " + str( hostport ) + " hw ether " + str( hostportmac )
-        command += ";" + " sudo ip link set " + str( hostport ) + " netns " + str( hostname )
+    def createHostport(self, hostname="host1", hostport="host1-eth0", ovsport="port1", hostportmac="000000000001" ):
+        command = "sudo ip link add " + str(hostport) +" type veth peer name " + str(ovsport)
+        command += ";" + "sudo ip link set " + str(hostport) + " up"
+        command += ";" + "sudo ip link set " + str(ovsport) + " up"
+        command += ";" +" sudo ifconfig " + str(hostport) + " hw ether " + str(hostportmac)
+        command += ";" +" sudo ip link set " + str(hostport) + " netns " + str(hostname)
         try:
             handle = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if re.search( "Error", handle ):
                 main.log.error( "Error in create host port " + str( hostport ) + " on " + str( hostname ) )
                 main.log.error( handle )
@@ -290,40 +291,40 @@
                 main.log.info( "Create host port " + str( hostport ) + " on " + str( hostname ) + " sucess" )
                 return main.TRUE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
-    def addPortToOvs( self, ifaceId, attachedMac, vmuuid, port="port1", ovsname="br-int" ):
-        command = "sudo ovs-vsctl add-port " + str( ovsname ) + " " + str( port )
+    def addPortToOvs(self, ifaceId, attachedMac, vmuuid, port="port1", ovsname="br-int" ):
+        command = "sudo ovs-vsctl add-port " + str(ovsname) +" " + str(port)
         if ifaceId:
-            command += " -- set Interface " + str( port ) + " external-ids:iface-id=" + str( ifaceId ) + " external-ids:iface-status=active"
+            command += " -- set Interface " + str(port) + " external-ids:iface-id=" + str(ifaceId) + " external-ids:iface-status=active"
         if attachedMac:
-            command += " external-ids:attached-mac=" + str( attachedMac )
+            command += " external-ids:attached-mac=" + str(attachedMac)
         if vmuuid:
-            command += " external-ids:vm-uuid=" + str( vmuuid )
+            command += " external-ids:vm-uuid=" + str(vmuuid)
         try:
             handle = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if re.search( "Error", handle ):
-                main.log.error( "Error in add port " + str( port ) + " to ovs " + str( ovsname ) )
+                main.log.error( "Error in add port " + str(port) + " to ovs " + str( ovsname ) )
                 main.log.error( handle )
                 return main.FALSE
             else:
-                main.log.info( "Add port " + str( port ) + " to ovs " + str( ovsname ) + " sucess" )
+                main.log.info( "Add port " + str(port) + " to ovs " + str( ovsname )  + " sucess" )
                 return main.TRUE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
-    def setHostportIp( self, ip, hostname="host1", hostport1="host1-eth0" ):
-        command = "sudo ip netns exec " + str( hostname ) + " ifconfig " + str( hostport1 ) + " " + str( ip )
+    def setHostportIp(self, ip, hostname="host1", hostport1="host1-eth0" ):
+        command = "sudo ip netns exec " + str(hostname) +" ifconfig " + str(hostport1) + " " + str(ip)
         try:
             handle = self.execute(
                 cmd=command,
-                timeout=10 )
+                timeout=10)
             if re.search( "Error", handle ):
                 main.log.error( "Error in set host ip for " + str( hostport1 ) + " on host " + str( hostname ) )
                 main.log.error( handle )
@@ -332,32 +333,32 @@
                 main.log.info( "Set host ip for " + str( hostport1 ) + " on host " + str( hostname ) + " sucess" )
                 return main.TRUE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
-    def hostPing( self, src, target, hostname="host1" ):
+    def hostPing(self, src, target, hostname="host1" ):
         if src:
-            command = "sudo ip netns exec " + str( hostname ) + " ping -c 1 -S " +\
-                str( src ) + " " + str( target )
+            command = "sudo ip netns exec " + str( hostname ) +" ping -c 1 -S " +\
+             str( src ) + " " + str( target )
         else:
-            command = "sudo ip netns exec " + str( hostname ) + " ping -c 1 " + str( target )
+            command = "sudo ip netns exec " + str( hostname ) +" ping -c 1 " + str( target )
         try:
-            for i in range( 1, 5 ):
+            for i in range(1,5):
                 handle = self.execute(
                     cmd=command,
-                    timeout=10 )
-                if re.search( ',\s0\%\spacket\sloss', handle ):
-                    main.log.info( self.name + ": no packets lost, host is reachable" )
+                    timeout=10)
+                if re.search(',\s0\%\spacket\sloss', handle):
+                    main.log.info(self.name + ": no packets lost, host is reachable")
                     return main.TRUE
                     break
-                time.sleep( 5 )
+                time.sleep(5)
             else:
-                main.log.info( self.name + ": packets lost, host is unreachable" )
+                main.log.info(self.name + ": packets lost, host is unreachable")
                 return main.FALSE
         except pexpect.EOF:
-            main.log.error( self.name + ": EOF exception found" )
-            main.log.error( self.name + ":     " + self.handle.before )
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
             main.cleanAndExit()
 
     def delBr( self, sw ):
@@ -367,7 +368,7 @@
         Return:
             Delete sucess return main.TRUE or main.FALSE on delete failed
         """
-        command = "sudo ovs-vsctl del-br " + str( sw )
+        command= "sudo ovs-vsctl del-br " + str( sw )
         try:
             response = self.execute(
                 cmd=command,
@@ -388,7 +389,7 @@
         Return:
             Delete sucess return main.TRUE or main.FALSE on delete failed
         """
-        command = "sudo ip netns delete " + str( hostname )
+        command= "sudo ip netns delete " + str( hostname )
         try:
             response = self.execute(
                 cmd=command,
diff --git a/TestON/drivers/common/cli/quaggaclidriver.py b/TestON/drivers/common/cli/quaggaclidriver.py
index 02c6af3..e1cbeef 100644
--- a/TestON/drivers/common/cli/quaggaclidriver.py
+++ b/TestON/drivers/common/cli/quaggaclidriver.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 """
-Copyright 2015 Open Networking Foundation ( ONF )
+Copyright 2015 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -9,7 +9,7 @@
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    ( at your option ) any later version.
+    (at your option) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,6 +19,7 @@
     You should have received a copy of the GNU General Public License
     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 """
+
 import time
 import pexpect
 import sys
@@ -57,9 +58,9 @@
                 ip_address="1.1.1.1",
                 port=self.port,
                 pwd=self.pwd )
-        # main.log.info( "connect parameters:" + str( self.user_name ) + ";"
+        #main.log.info( "connect parameters:" + str( self.user_name ) + ";"
         #               + str( self.ip_address ) + ";" + str( self.port )
-        #               + ";" + str( self.pwd ) )
+        #               + ";" + str(self.pwd ) )
 
         if self.handle:
             # self.handle.expect( "",timeout=10 )
@@ -207,7 +208,7 @@
         routesJsonObj = json.loads( getRoutesResult )
 
         allRoutesActual = []
-        for route in routesJsonObj[ 'routes4' ]:
+        for route in routesJsonObj['routes4']:
             if 'prefix' in route:
                 if route[ 'prefix' ] == '172.16.10.0/24':
                     continue
@@ -220,7 +221,7 @@
         routesJsonObj = json.loads( getRoutesResult )
 
         allRoutesActual = []
-        for route in routesJsonObj[ 'routes4' ]:
+        for route in routesJsonObj['routes4']:
             if route[ 'prefix' ] == '172.16.10.0/24':
                 continue
             allRoutesActual.append(
@@ -236,10 +237,10 @@
         intentsJsonObj = json.loads( getIntentsResult )
 
         for intent in intentsJsonObj:
-            # if intent[ 'appId' ] != "org.onosproject.sdnip":
+            #if intent[ 'appId' ] != "org.onosproject.sdnip":
             #    continue
             if intent[ 'type' ] == "MultiPointToSinglePointIntent" \
-                    and intent[ 'state' ] == 'INSTALLED':
+            and intent[ 'state' ] == 'INSTALLED':
                 egress = str( intent[ 'egress' ][ 'device' ] ) + ":" \
                     + str( intent[ 'egress' ][ 'port' ] )
                 ingress = []
@@ -265,7 +266,7 @@
         num = 0
         for intent in intentsJsonObj:
             if intent[ 'type' ] == "MultiPointToSinglePointIntent" \
-                    and intent[ 'state' ] == 'INSTALLED':
+            and intent[ 'state' ] == 'INSTALLED':
                 num = num + 1
         return num
 
@@ -275,7 +276,7 @@
         num = 0
         for intent in intentsJsonObj:
             if intent[ 'type' ] == "PointToPointIntent" \
-                    and intent[ 'state' ] == 'INSTALLED':
+            and intent[ 'state' ] == 'INSTALLED':
                 num = num + 1
         return num
 
@@ -287,10 +288,10 @@
         intentsJsonObj = json.loads( getIntentsResult )
 
         for intent in intentsJsonObj:
-            # if intent[ 'appId' ] != "org.onosproject.sdnip":
+            #if intent[ 'appId' ] != "org.onosproject.sdnip":
             #    continue
             if intent[ 'type' ] == "PointToPointIntent" \
-                    and "protocol=6" in str( intent[ 'selector' ] ):
+            and "protocol=6" in str( intent[ 'selector' ] ):
                 ingress = str( intent[ 'ingress' ][ 'device' ] ) + ":" \
                     + str( intent[ 'ingress' ][ 'port' ] )
                 egress = str( intent[ 'egress' ][ 'device' ] ) + ":" + \
@@ -324,15 +325,15 @@
             # find out the BGP speaker IP address for this BGP peer
             bgpSpeakerIpAddress = ""
             for interfaceAddress in \
-                    sdnipData[ 'bgpSpeakers' ][ 0 ][ 'interfaceAddresses' ]:
+            sdnipData[ 'bgpSpeakers' ][ 0 ][ 'interfaceAddresses' ]:
                 # if eq( interfaceAddress[ 'interfaceDpid' ],sdnipData[
                 # 'bgpSpeakers' ][ 0 ][ 'attachmentDpid' ] ) and eq(
                 # interfaceAddress[ 'interfacePort' ], sdnipData[ 'bgpSpeakers'
                 # ][ 0 ][ 'attachmentPort' ] ):
                 if eq( interfaceAddress[ 'interfaceDpid' ],
                        peer[ 'attachmentDpid' ] ) \
-                    and eq( interfaceAddress[ 'interfacePort' ],
-                            peer[ 'attachmentPort' ] ):
+                and eq( interfaceAddress[ 'interfacePort' ],
+                        peer[ 'attachmentPort' ] ):
                     bgpSpeakerIpAddress = interfaceAddress[ 'ipAddress' ]
                     break
                 else:
@@ -342,9 +343,9 @@
             # direction
             selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress + "/32}," \
                 + "IPV4_DST{ip=" + peer[ 'ipAddress' ] + "/32}," \
-                + "IP_PROTO{ protocol=6 }, ETH_TYPE{ ethType=800 }, \
-                TCP_DST{ tcpPort=179 }"
-            selector = selectorStr.replace( " ", "" ).replace( "[", "" )\
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_DST{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
                 .replace( "]", "" ).split( "," )
             intent = bgpSpeakerAttachmentPoint + "/" + \
                 bgpPeerAttachmentPoint + "/" + str( sorted( selector ) )
@@ -352,9 +353,9 @@
 
             selectorStr = "IPV4_SRC{ip=" + bgpSpeakerIpAddress + "/32}," \
                 + "IPV4_DST{ip=" + peer[ 'ipAddress' ] + "/32}," \
-                + "IP_PROTO{ protocol=6 }, ETH_TYPE{ ethType=800 }, \
-                TCP_SRC{ tcpPort=179 }"
-            selector = selectorStr.replace( " ", "" ).replace( "[", "" )\
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_SRC{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
                 .replace( "]", "" ).split( "," )
             intent = bgpSpeakerAttachmentPoint + "/" \
                 + bgpPeerAttachmentPoint + "/" + str( sorted( selector ) )
@@ -364,9 +365,9 @@
             # direction
             selectorStr = "IPV4_SRC{ip=" + peer[ 'ipAddress' ] + "/32}," \
                 + "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," \
-                + "IP_PROTO{ protocol=6 }, ETH_TYPE{ ethType=800 }, \
-                TCP_DST{ tcpPort=179 }"
-            selector = selectorStr.replace( " ", "" ).replace( "[", "" )\
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_DST{tcpPort=179}"
+            selector = selectorStr.replace( " ", "" ).replace("[", "" )\
                 .replace( "]", "" ).split( "," )
             intent = bgpPeerAttachmentPoint + "/" \
                 + bgpSpeakerAttachmentPoint + "/" + str( sorted( selector ) )
@@ -374,8 +375,8 @@
 
             selectorStr = "IPV4_SRC{ip=" + peer[ 'ipAddress' ] + "/32}," \
                 + "IPV4_DST{ip=" + bgpSpeakerIpAddress + "/32}," \
-                + "IP_PROTO{ protocol=6 }, ETH_TYPE{ ethType=800 }, \
-                TCP_SRC{ tcpPort=179 }"
+                + "IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, \
+                TCP_SRC{tcpPort=179}"
             selector = selectorStr.replace( " ", "" ).replace( "[", "" )\
                 .replace( "]", "" ).split( "," )
             intent = bgpPeerAttachmentPoint + "/" \
@@ -399,23 +400,23 @@
 
         chunk_size = 20
 
-        if len( routes ) > chunk_size:
-            num_iter = ( int )( len( routes ) / chunk_size )
+        if len(routes) > chunk_size:
+            num_iter = (int) (len(routes) / chunk_size)
         else:
-            num_iter = 1
+            num_iter = 1;
 
         total = 0
-        for n in range( 0, num_iter + 1 ):
+        for n in range( 0, num_iter + 1):
             routeCmd = ""
-            if ( len( routes ) - ( n * chunk_size ) ) >= chunk_size:
-                m = ( n + 1 ) * chunk_size
+            if (len( routes ) - (n * chunk_size)) >= chunk_size:
+                m = (n + 1) * chunk_size
             else:
                 m = len( routes )
             for i in range( n * chunk_size, m ):
                 routeCmd = routeCmd + "network " + routes[ i ] + "\n"
                 total = total + 1
 
-            main.log.info( routeCmd )
+            main.log.info(routeCmd)
             try:
                 self.handle.sendline( routeCmd )
                 self.handle.expect( "bgpd", timeout=5 )
@@ -424,8 +425,8 @@
                 self.disconnect()
 
             # waitTimer = 1.00 / routeRate
-            main.log.info( "Total routes so far " + ( ( str )( total ) ) + " wait for 0 sec" )
-            # time.sleep( 1 )
+            main.log.info("Total routes so far " + ((str) (total)) + " wait for 0 sec")
+            #time.sleep( 1 )
         if routesAdded == len( routes ):
             main.log.info( "Finished adding routes" )
             return main.TRUE
@@ -488,6 +489,7 @@
             main.log.info( "NO HANDLE" )
             return main.FALSE
 
+
     # Please use the generateRoutes plus addRoutes instead of this one!
     def addRoute( self, net, numRoutes, routeRate ):
         try:
@@ -611,7 +613,7 @@
             count = 0
             while True:
                 i = child.expect( [ '17\d\.\d{1,3}\.\d{1,3}\.\d{1,3}',
-                                    'CLI#', pexpect.TIMEOUT ] )
+                                   'CLI#', pexpect.TIMEOUT ] )
                 if i == 0:
                     count = count + 1
                 elif i == 1:
@@ -698,3 +700,4 @@
             main.log.error( "Connection failed to the host" )
             response = main.FALSE
         return response
+
diff --git a/TestON/drivers/common/cli/remotesysdriver.py b/TestON/drivers/common/cli/remotesysdriver.py
index 3c5dd17..48046f1 100644
--- a/TestON/drivers/common/cli/remotesysdriver.py
+++ b/TestON/drivers/common/cli/remotesysdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
diff --git a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
index 58667a1..b923a20 100644
--- a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 12-Feb-2013
-Copyright 2013 Open Networking Foundation ( ONF )
+Copyright 2013 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -28,7 +28,6 @@
 """
 from drivers.common.cli.remotetestbeddriver import RemoteTestBedDriver
 
-
 class FloodLightCliDriver( RemoteTestBedDriver ):
 
     """
diff --git a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
index 9ab454d..b04b95c 100644
--- a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
@@ -1,5 +1,5 @@
 """
-Copyright 2015 Open Networking Foundation ( ONF )
+Copyright 2015 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -18,6 +18,7 @@
     You should have received a copy of the GNU General Public License
     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 """
+
 class NEC:
 
     def __init__( self ):
diff --git a/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py b/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
index 8369c24..9a556c9 100644
--- a/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/remotepoxdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 12-Feb-2013
-Copyright 2013 Open Networking Foundation ( ONF )
+Copyright 2013 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
diff --git a/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py b/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
index ebb3d75..5875169 100644
--- a/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/remotevmdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 12-Feb-2013
-Copyright 2013 Open Networking Foundation ( ONF )
+Copyright 2013 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
diff --git a/TestON/drivers/common/cli/remotetestbeddriver.py b/TestON/drivers/common/cli/remotetestbeddriver.py
index 8dc73d5..e4bbbad 100644
--- a/TestON/drivers/common/cli/remotetestbeddriver.py
+++ b/TestON/drivers/common/cli/remotetestbeddriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Oct-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
diff --git a/TestON/drivers/common/cli/tool/dpctlclidriver.py b/TestON/drivers/common/cli/tool/dpctlclidriver.py
index dfff992..0dd15ee 100644
--- a/TestON/drivers/common/cli/tool/dpctlclidriver.py
+++ b/TestON/drivers/common/cli/tool/dpctlclidriver.py
@@ -1,7 +1,7 @@
-# /usr/bin/env python
+#/usr/bin/env python
 """
 Created on 26-Nov-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -50,9 +50,9 @@
 
         self.handle = super(
                    DpctlCliDriver, self ).connect( user_name=self.user_name,
-                                                   ip_address=self.ip_address,
-                                                   port=None,
-                                                   pwd=self.pwd )
+                   ip_address=self.ip_address,
+                   port=None,
+                   pwd=self.pwd )
         if self.handle:
             main.log.info( "Connected to the host" )
             return main.TRUE
@@ -74,7 +74,7 @@
                                      "INPORT",
                                      "ACTION",
                                      "TIMEOUT" ],
-                                     **flowParameters )
+                             **flowParameters )
 
         cmd = "dpctl add-flow tcp:"
         tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
@@ -258,7 +258,7 @@
                                      "TCPIP",
                                      "TCPPORT",
                                      "STRING" ],
-                                     **flowParameters )
+                            **flowParameters )
 
         tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
         tcpPort = args[ "TCPPORT" ] if args[
@@ -286,7 +286,7 @@
                                      "TCPIP",
                                      "TCPPORT",
                                      "STRING" ],
-                                     **flowParameters )
+                             **flowParameters )
 
         tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
         tcpPort = args[ "TCPPORT" ] if args[
@@ -306,3 +306,4 @@
 if __name__ != "__main__":
     import sys
     sys.modules[ __name__ ] = DpctlCliDriver()
+
diff --git a/TestON/drivers/common/cli/toolsdriver.py b/TestON/drivers/common/cli/toolsdriver.py
index c31dbf7..79a0db2 100644
--- a/TestON/drivers/common/cli/toolsdriver.py
+++ b/TestON/drivers/common/cli/toolsdriver.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 """
 Created on 26-Nov-2012
-Copyright 2012 Open Networking Foundation ( ONF )
+Copyright 2012 Open Networking Foundation (ONF)
 
 Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
 the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,