diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index ef5eb99..cb80126 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.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
@@ -18,7 +18,6 @@
     You should have received a copy of the GNU General Public License
     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 """
-
 # Testing the basic intent functionality of ONOS
 
 
@@ -36,7 +35,6 @@
             - Checkout ONOS master branch
             - Pull latest ONOS code
         """
-
         try:
             from tests.dependencies.ONOSSetup import ONOSSetup
             main.testSetUp = ONOSSetup()
@@ -222,7 +220,6 @@
                                " not discovered yet. One device is allowed" +\
                                ", the other disallowed."
 
-
         pprint = main.Cluster.active( 0 ).REST.pprint
 
         main.step( "Add Net Cfg for switch1" )
@@ -241,14 +238,14 @@
                                                               subjectKey="of:0000000000000001",
                                                               configKey="basic" )
         s1Result = False
-        #Wait 5 secs after set up netCfg
+        # Wait 5 secs after set up netCfg
         time.sleep( main.SetNetCfgSleep )
         if setS1Allow:
             getS1 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
                                      retValue=False,
-                                     kwargs={"subjectClass":"devices",
-                                             "subjectKey" : "of:0000000000000001",
-                                             "configKey" : "basic"},
+                                     kwargs={ "subjectClass": "devices",
+                                              "subjectKey": "of:0000000000000001",
+                                              "configKey": "basic" },
                                      attempts=main.retrytimes,
                                      sleep=main.retrysleep )
             onosCfg = pprint( getS1 )
@@ -290,9 +287,9 @@
             # Check what we set is what is in ONOS
             getS3 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
                                      retValue=False,
-                                     kwargs={"subjectClass": "devices",
-                                            "subjectKey": "of:0000000000000003",
-                                            "configKey": "basic"},
+                                     kwargs={ "subjectClass": "devices",
+                                              "subjectKey": "of:0000000000000003",
+                                              "configKey": "basic" },
                                      attempts=main.retrytimes,
                                      sleep=main.retrysleep )
             onosCfg = pprint( getS3 )
@@ -400,9 +397,9 @@
             # Check what we set is what is in ONOS
             getS2 = utilities.retry( f=main.Cluster.active( 1 ).REST.getNetCfg,
                                      retValue=False,
-                                     kwargs={"subjectClass": "devices",
-                                            "subjectKey": "of:0000000000000002",
-                                            "configKey": "basic"},
+                                     kwargs={ "subjectClass": "devices",
+                                              "subjectKey": "of:0000000000000002",
+                                              "configKey": "basic" },
                                      attempts=main.retrytimes,
                                      sleep=main.retrysleep )
             onosCfg = pprint( getS2 )
@@ -432,17 +429,17 @@
         main.log.info( "s4Json:" + str( s4Json ) )
         main.s4Json = s4Json
         setS4Disallow = main.Cluster.active( 2 ).REST.setNetCfg( s4Json,
-                                                  subjectClass="devices",
-                                                  subjectKey="of:0000000000000004",
-                                                  configKey="basic" )
+                                                                 subjectClass="devices",
+                                                                 subjectKey="of:0000000000000004",
+                                                                 configKey="basic" )
         s4Result = False
         if setS4Disallow:
             # Check what we set is what is in ONOS
             getS4 = utilities.retry( f=main.Cluster.active( 2 ).REST.getNetCfg,
                                      retValue=False,
-                                     kwargs={"subjectClass": "devices",
-                                            "subjectKey": "of:0000000000000004",
-                                            "configKey": "basic"},
+                                     kwargs={ "subjectClass": "devices",
+                                              "subjectKey": "of:0000000000000004",
+                                              "configKey": "basic" },
                                      attempts=main.retrytimes,
                                      sleep=main.retrysleep )
 
@@ -511,8 +508,6 @@
                                  onpass="Configured devices' annotations are correct",
                                  onfail="Incorrect annotations for configured devices." )
 
-
-
     def CASE24( self, main ):
         """
         Testing removal of configurations
@@ -616,8 +611,8 @@
         main.step( "Assert the net config for devices is empty" )
 
         get = utilities.retry( f=main.Cluster.active( 2 ).REST.getNetCfg,
-                               retValue = False,
-                               kwargs={"subjectClass":"devices"},
+                               retValue=False,
+                               kwargs={ "subjectClass": "devices" },
                                sleep=main.retrysleep,
                                attempts=main.retrytimes )
 
@@ -746,9 +741,9 @@
         if setS6Disallow:
             getS6 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
                                      retValue=False,
-                                     kwargs={"subjectClass":"devices",
-                                            "subjectKey" : "of:0000000000000006",
-                                            "configKey" : "basic"},
+                                     kwargs={ "subjectClass": "devices",
+                                              "subjectKey": "of:0000000000000006",
+                                              "configKey": "basic" },
                                      sleep=main.retrysleep,
                                      attempts=main.retrytimes )
             onosCfg = pprint( getS6 )
diff --git a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
index 0cc46e8..9523e81 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.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
@@ -35,19 +35,19 @@
     responses = []
     result = utilities.retry( f=checkNodeResponses,
                               retValue=False,
-                              kwargs={'main' : main,'responses' : responses},
-                              sleep = main.retrysleep,
-                              attempts = main.retrytimes )
+                              kwargs={ 'main': main, 'responses': responses },
+                              sleep=main.retrysleep,
+                              attempts=main.retrytimes )
     utilities.assert_equals( expect=True,
                              actual=result,
                              onpass="Net Cfg is the same on all nodes",
                              onfail="Check Net Cfg failed. Check above messages." )
 
 
-def checkNodeResponses ( main, responses ):
+def checkNodeResponses( main, responses ):
     numberOfFailedNodes = 0  # Tracks the number of nodes that failed to get net configuration
     for ctrl in main.Cluster.active():
-        response = ctrl.REST.getNetCfg( )
+        response = ctrl.REST.getNetCfg()
         responses.append( ctrl.REST.pprint( response ) )
         if response == main.FALSE:
             numberOfFailedNodes += 1
@@ -65,24 +65,25 @@
             main.log.debug( i )
     return False
 
+
 def checkDeviceAnnotations( main, jsonObj, sw ):
     id = str( sw.get( 'id' ) )
     keys = [ 'name', 'owner', 'rackAddress' ]
     correct = True
     for k in keys:
-        if str( sw.get( 'annotations', {} ).get( k ) ) != str( jsonObj[ k ] ) :
+        if str( sw.get( 'annotations', {} ).get( k ) ) != str( jsonObj[ k ] ):
             correct = False
             main.log.debug( "{} is wrong on switch: ".format( k ) + id )
     if not correct:
-        main.log.error( "Annotations for switch " + id  + " are incorrect: {}".format( sw ) )
+        main.log.error( "Annotations for switch " + id + " are incorrect: {}".format( sw ) )
     return correct
 
 
 def checkAllDeviceAnnotations( main, json ):
-    devices = main.Cluster.active( 0 ).REST.devices( )
+    devices = main.Cluster.active( 0 ).REST.devices()
     id = "of:0000000000000001"
     i = 1
-    result = [ ]
+    result = []
     try:
         for sw in json.loads( devices ):
             if id in sw.get( 'id' ):
