diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
index 3563efb..3f1f91d 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
@@ -14,6 +14,7 @@
 """
 import os
 
+
 class FUNCovsdbtest:
 
     def __init__( self ):
@@ -46,8 +47,8 @@
         gitBranch = main.params[ 'GIT' ][ 'branch' ]
         cellName = main.params[ 'ENV' ][ 'cellName' ]
         ipList = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
-        main.startUpSleep = int( main.params['SLEEP']['startup'] )
-        cellAppString = main.params['ENV']['cellApps']
+        main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+        cellAppString = main.params[ 'ENV' ][ 'cellApps' ]
 
         if gitPull == 'True':
             main.step( "Building ONOS in " + gitBranch + "branch" )
@@ -56,10 +57,10 @@
             utilities.assert_equals( expect=main.TRUE,
                                      actual=stepResult,
                                      onpass="Successfully compiled latest ONOS",
-                                     onfail="Failed to compile latest ONOS")
+                                     onfail="Failed to compile latest ONOS" )
         else:
             main.log.warn( "Did not pull new code so skipping mvn " +
-                          "clean install" )
+                           "clean install" )
         main.ONOSbench.getVersion( report=True )
 
         main.log.info( "Safety check, killing all ONOS processes" +
@@ -70,7 +71,7 @@
 
         main.CLIs = []
         main.nodes = []
-        main.numCtrls= 1
+        main.numCtrls = 1
 
         for i in range( 1, main.numCtrls + 1 ):
             try:
@@ -115,7 +116,6 @@
                                  onpass="Successfully applied cell to environment",
                                  onfail="Failed to apply cell to environment" )
 
-
         main.step( "Creating ONOS package" )
         packageResult = main.ONOSbench.buckBuild()
         utilities.assert_equals( expect=main.TRUE,
@@ -125,7 +125,7 @@
 
         time.sleep( main.startUpSleep )
         main.step( "Installing ONOS package" )
-        onosInstallResult = main.ONOSbench.onosInstall( options="-f", node=main.nodes[0].ip_address )
+        onosInstallResult = main.ONOSbench.onosInstall( options="-f", node=main.nodes[ 0 ].ip_address )
         utilities.assert_equals( expect=main.TRUE, actual=onosInstallResult,
                                  onpass="Successfully installed ONOS package",
                                  onfail="Failed to install ONOS package" )
@@ -139,7 +139,7 @@
                                  onfail="Test step FAIL" )
 
         time.sleep( main.startUpSleep )
-        main.step("Starting ONOS service")
+        main.step( "Starting ONOS service" )
         stopResult = main.TRUE
         startResult = main.TRUE
         onos1Isup = main.TRUE
@@ -150,7 +150,7 @@
                 main.log.report( "ONOS instance {0} is up and ready".format( i + 1 ) )
             else:
                 main.log.report( "ONOS instance {0} may not be up, stop and ".format( i + 1 ) +
-                                "start ONOS again" )
+                                 "start ONOS again" )
                 stopResult = stopResult and main.ONOSbench.onosStop( main.ONOSip[ i ] )
                 startResult = startResult and main.ONOSbench.onosStart( main.ONOSip[ i ] )
                 if not startResult or stopResult:
@@ -195,7 +195,6 @@
                                  onfail="Install onos-app-vtn failed" )
 
     def CASE2( self, main ):
-
         """
         Test ovsdb connection and teardown
         """
@@ -226,7 +225,7 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Check ovsdb node manager is " + str( response ) ,
+                                 onpass="Check ovsdb node manager is " + str( response ),
                                  onfail="Check ovsdb node manager failed" )
 
         main.step( "Delete ovsdb node manager" )
@@ -249,7 +248,6 @@
                                  onfail="Check ovsdb node delete manager failed" )
 
     def CASE3( self, main ):
-
         """
         Test default br-int configuration and vxlan port
         """
@@ -263,17 +261,17 @@
         ctrlip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
         ovsdbport = main.params[ 'CTRL' ][ 'ovsdbport' ]
         delaytime = main.params[ 'TIMER' ][ 'delaytime' ]
-        OVSDB1Ip = os.getenv( main.params['OVSDB']['ip1'] )
-        OVSDB2Ip = os.getenv( main.params['OVSDB']['ip2'] )
+        OVSDB1Ip = os.getenv( main.params[ 'OVSDB' ][ 'ip1' ] )
+        OVSDB2Ip = os.getenv( main.params[ 'OVSDB' ][ 'ip2' ] )
 
         main.step( "ovsdb node 1 set ovs manager to " + str( ctrlip ) )
         assignResult = main.OVSDB1.setManager( ip=ctrlip, port=ovsdbport, delaytime=delaytime )
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 set ovs manager to  to " +\
+                                 onpass="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 1 set ovs manager to  to " +\
+                                 onfail="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "ovsdb node 2 set ovs manager to " + str( ctrlip ) )
@@ -281,9 +279,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 2 set ovs manager to  to " +\
+                                 onpass="ovsdb node 2 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 2 set ovs manager to  to " +\
+                                 onfail="ovsdb node 2 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "Check ovsdb node 1 manager is " + str( ctrlip ) )
@@ -294,7 +292,7 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 manager is " + str( response ) ,
+                                 onpass="ovsdb node 1 manager is " + str( response ),
                                  onfail="ovsdb node 1 manager check failed" )
 
         main.step( "Check ovsdb node 2 manager is " + str( ctrlip ) )
@@ -305,7 +303,7 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 2 manager is " + str( response ) ,
+                                 onpass="ovsdb node 2 manager is " + str( response ),
                                  onfail="ovsdb node 2 manager check failed" )
 
         main.step( "Check default br-int bridge on ovsdb node " + str( OVSDB1Ip ) )
@@ -353,7 +351,6 @@
                                  onfail="onos add default vxlan port on the node 2 failed" )
 
     def CASE4( self, main ):
-
         """
         Test default openflow configuration
         """
@@ -369,9 +366,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 set ovs manager to  to " +\
+                                 onpass="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 1 set ovs manager to  to " +\
+                                 onfail="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "ovsdb node 2 set ovs manager to " + str( ctrlip ) )
@@ -379,9 +376,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 2 set ovs manager to  to " +\
+                                 onpass="ovsdb node 2 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 2 set ovs manager to  to " +\
+                                 onfail="ovsdb node 2 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "Check ovsdb node 1 manager is " + str( ctrlip ) )
@@ -392,8 +389,8 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 manager is " + str( response ) ,
-                                 onfail="ovsdb node 1 manager check failed\n" +\
+                                 onpass="ovsdb node 1 manager is " + str( response ),
+                                 onfail="ovsdb node 1 manager check failed\n" +
                                  str( main.OVSDB1.show() ) )
 
         main.step( "Check ovsdb node 2 manager is " + str( ctrlip ) )
@@ -404,8 +401,8 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 2 manager is " + str( response ) ,
-                                 onfail="ovsdb node 2 manager check failed\n" +\
+                                 onpass="ovsdb node 2 manager is " + str( response ),
+                                 onfail="ovsdb node 2 manager check failed\n" +
                                  str( main.OVSDB2.show() ) )
 
         main.step( "Check ovsdb node 1 bridge br-int controller set to " + str( ctrlip ) )
@@ -416,9 +413,9 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Check ovsdb node 1 bridge br-int controller set to " +\
+                                 onpass="Check ovsdb node 1 bridge br-int controller set to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="Check ovsdb node 1 bridge br-int controller set to " +\
+                                 onfail="Check ovsdb node 1 bridge br-int controller set to " +
                                   str( ctrlip ) + " failed\n" + str( main.OVSDB1.show() ) )
 
         main.step( "Check ovsdb node 2 bridge br-int controller set to  " + str( ctrlip ) )
@@ -429,10 +426,10 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Check ovsdb node 2 bridge br-int controller set to " +\
+                                 onpass="Check ovsdb node 2 bridge br-int controller set to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="Check ovsdb node 2 bridge br-int controller set to " +\
-                                  str( ctrlip ) + " failed\n" + str( main.OVSDB2.show()) )
+                                 onfail="Check ovsdb node 2 bridge br-int controller set to " +
+                                  str( ctrlip ) + " failed\n" + str( main.OVSDB2.show() ) )
 
         main.step( "Check onoscli devices have ovs " + str( OVSDB1Ip ) )
         response = main.ONOScli1.devices()
@@ -457,7 +454,6 @@
                                  onfail="Check onoscli devices have ovs " + str( OVSDB2Ip ) + " failed" )
 
     def CASE5( self, main ):
-
         """
         Test default flows
         """
@@ -473,9 +469,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 set ovs manager to  to " +\
+                                 onpass="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 1 set ovs manager to  to " +\
+                                 onfail="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "Check ovsdb node 1 manager is " + str( ctrlip ) )
@@ -486,7 +482,7 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 manager is " + str( response ) ,
+                                 onpass="ovsdb node 1 manager is " + str( response ),
                                  onfail="ovsdb node 1 manager check failed" )
 
         main.step( "Check ovsdb node 1 bridge br-int default flows on " + str( OVSDB1Ip ) )
@@ -497,7 +493,7 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully set default flows " + str( ctrlip ) ,
+                                 onpass="Successfully set default flows " + str( ctrlip ),
                                  onfail="Failed to set default flows " + str( ctrlip ) )
 
     def CASE6( self, main ):
@@ -521,9 +517,9 @@
         main.caseExplanation = "Configure Network Subnet Port " +\
                                 "Verify post is OK"
 
-        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
-        httpport = main.params['HTTP']['port']
-        path = main.params['HTTP']['path']
+        ctrlip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
+        httpport = main.params[ 'HTTP' ][ 'port' ]
+        path = main.params[ 'HTTP' ][ 'path' ]
 
         main.step( "Generate Post Data" )
         network = NetworkData()
@@ -593,7 +589,6 @@
                 onfail="Post Port Failed " + str( Poststatus ) + "," + str( result ) )
 
     def CASE7( self, main ):
-
         """
         Test host go online and ping each other
         """
@@ -609,9 +604,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 1 set ovs manager to  to " +\
+                                 onpass="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 1 set ovs manager to  to " +\
+                                 onfail="ovsdb node 1 set ovs manager to  to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "ovsdb node 2 set ovs manager to " + str( ctrlip ) )
@@ -619,9 +614,9 @@
         stepResult = assignResult
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="ovsdb node 2 set ovs manager to " +\
+                                 onpass="ovsdb node 2 set ovs manager to " +
                                   str( ctrlip ) + " sucess",
-                                 onfail="ovsdb node 2 set ovs manager to " +\
+                                 onfail="ovsdb node 2 set ovs manager to " +
                                   str( ctrlip ) + " failed" )
 
         main.step( "Create host1 on node 1 " + str( OVSDB1Ip ) )
@@ -638,38 +633,38 @@
                                  onpass="Create host2 on node 2 " + str( OVSDB2Ip ) + " sucess",
                                  onfail="Create host2 on node 2 " + str( OVSDB2Ip ) + " failed" )
 
-        main.step( "Create port on host1 on the node " + str ( OVSDB1Ip ) )
+        main.step( "Create port on host1 on the node " + str( OVSDB1Ip ) )
         stepResult = main.OVSDB1.createHostport( hostname="host1", hostport="host1-eth0", hostportmac="000000000001" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Create port on host1 on the node " + str( OVSDB1Ip ) + " sucess",
                                  onfail="Create port on host1 on the node " + str( OVSDB1Ip ) + " failed" )
 
-        main.step( "Create port on host2 on the node " + str ( OVSDB2Ip ) )
+        main.step( "Create port on host2 on the node " + str( OVSDB2Ip ) )
         stepResult = main.OVSDB2.createHostport( hostname="host2", hostport="host2-eth0", hostportmac="000000000002" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Create port on host1 on the node " + str( OVSDB2Ip ) + " sucess",
                                  onfail="Create port on host1 on the node " + str( OVSDB2Ip ) + " failed" )
 
-        main.step( "Add port to ovs br-int and host go-online on the node " + str ( OVSDB1Ip ) )
+        main.step( "Add port to ovs br-int and host go-online on the node " + str( OVSDB1Ip ) )
         stepResult = main.OVSDB1.addPortToOvs( ovsname="br-int", ifaceId="00000000-0000-0000-0000-000000000001",
                                                attachedMac="00:00:00:00:00:01", vmuuid="10000000-0000-0000-0000-000000000001" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Add port to ovs br-int and host go-online on the node " +\
+                                 onpass="Add port to ovs br-int and host go-online on the node " +
                                   str( OVSDB1Ip ) + " sucess",
-                                 onfail="Add port to ovs br-int and host go-online on the node " +\
+                                 onfail="Add port to ovs br-int and host go-online on the node " +
                                   str( OVSDB1Ip ) + " failed" )
 
-        main.step( "Add port to ovs br-int and host go-online on the node " + str ( OVSDB2Ip ) )
+        main.step( "Add port to ovs br-int and host go-online on the node " + str( OVSDB2Ip ) )
         stepResult = main.OVSDB2.addPortToOvs( ovsname="br-int", ifaceId="00000000-0000-0000-0000-000000000002",
                                                attachedMac="00:00:00:00:00:02", vmuuid="10000000-0000-0000-0000-000000000001" )
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Add port to ovs br-int and host go-online on the node " +\
+                                 onpass="Add port to ovs br-int and host go-online on the node " +
                                   str( OVSDB2Ip ) + " sucess",
-                                 onfail="Add port to ovs br-int and host go-online on the node " +\
+                                 onfail="Add port to ovs br-int and host go-online on the node " +
                                   str( OVSDB2Ip ) + " failed" )
 
         main.step( "Check onos set host flows on the node " + str( OVSDB1Ip ) )
@@ -680,9 +675,9 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Check onos set host flows on the node " +\
+                                 onpass="Check onos set host flows on the node " +
                                   str( OVSDB1Ip ) + " sucess",
-                                 onfail="Check onos set host flows on the node " +\
+                                 onfail="Check onos set host flows on the node " +
                                   str( OVSDB1Ip ) + " failed" )
 
         main.step( "Check onos set host flows on the node " + str( OVSDB2Ip ) )
@@ -693,9 +688,9 @@
             stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Check onos set host flows on the node " +\
+                                 onpass="Check onos set host flows on the node " +
                                   str( OVSDB2Ip ) + " sucess",
-                                 onfail="Check onos set host flows on the node " +\
+                                 onfail="Check onos set host flows on the node " +
                                   str( OVSDB2Ip ) + " failed" )
 
         main.step( "Check hosts can ping each other" )
@@ -706,13 +701,12 @@
         stepResult = pingResult1 and pingResult2
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
-                                 onpass="Successfully host go online and ping each other,controller is " +\
+                                 onpass="Successfully host go online and ping each other,controller is " +
                                         str( ctrlip ),
-                                 onfail="Failed to host go online and ping each other,controller is " +\
+                                 onfail="Failed to host go online and ping each other,controller is " +
                                         str( ctrlip ) )
 
     def CASE8( self, main ):
-
         """
         Clear ovs configuration and host configuration
         """
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py b/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
index 3fde20d..6c8725e 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
@@ -4,9 +4,10 @@
 """
 import json
 
+
 class NetworkData:
 
-    def __init__(self):
+    def __init__( self ):
         self.id = ''
         self.state = 'ACTIVE'
         self.name = 'onosfw-1'
@@ -14,76 +15,77 @@
         self.admin_state_up = True
         self.tenant_id = ''
         self.routerExternal = False
-        self.type ='LOCAL'
+        self.type = 'LOCAL'
         self.segmentationID = '6'
         self.shared = False
 
-    def DictoJson(self):
+    def DictoJson( self ):
 
-        if self.id =='' or self.tenant_id == '':
+        if self.id == '' or self.tenant_id == '':
             print 'Id and tenant id is necessary!'
 
         Dicdata = {}
-        if self.id !='':
-            Dicdata['id'] = self.id
+        if self.id != '':
+            Dicdata[ 'id' ] = self.id
         if self.state != '':
-            Dicdata['status'] = self.state
-        if self.name !='':
-            Dicdata['name'] = self.name
-        if self.physicalNetwork !='':
-            Dicdata['provider:physical_network'] = self.physicalNetwork
-        if self.admin_state_up !='':
-            Dicdata['admin_state_up'] = self.admin_state_up
-        if self.tenant_id !='':
-            Dicdata['tenant_id'] = self.tenant_id
-        if self.routerExternal !='':
-            Dicdata['router:external'] = self.routerExternal
-        if self.type !='':
-            Dicdata['provider:network_type'] = self.type
-        if self.segmentationID !='':
-            Dicdata['provider:segmentation_id'] = self.segmentationID
-        if self.shared !='':
-            Dicdata['shared'] = self.shared
+            Dicdata[ 'status' ] = self.state
+        if self.name != '':
+            Dicdata[ 'name' ] = self.name
+        if self.physicalNetwork != '':
+            Dicdata[ 'provider:physical_network' ] = self.physicalNetwork
+        if self.admin_state_up != '':
+            Dicdata[ 'admin_state_up' ] = self.admin_state_up
+        if self.tenant_id != '':
+            Dicdata[ 'tenant_id' ] = self.tenant_id
+        if self.routerExternal != '':
+            Dicdata[ 'router:external' ] = self.routerExternal
+        if self.type != '':
+            Dicdata[ 'provider:network_type' ] = self.type
+        if self.segmentationID != '':
+            Dicdata[ 'provider:segmentation_id' ] = self.segmentationID
+        if self.shared != '':
+            Dicdata[ 'shared' ] = self.shared
 
-        Dicdata = {'network': Dicdata}
+        Dicdata = { 'network': Dicdata }
 
-        return json.dumps(Dicdata,indent=4)
+        return json.dumps( Dicdata, indent=4 )
 
-    def Ordered(self,obj):
+    def Ordered( self, obj ):
 
-        if isinstance(obj, dict):
-            return sorted((k,self.Ordered(v)) for k,  v in obj.items())
-        if isinstance(obj, list):
-            return sorted(self.Ordered(x) for x in obj )
+        if isinstance( obj, dict ):
+            return sorted( ( k, self.Ordered( v ) ) for k, v in obj.items() )
+        if isinstance( obj, list ):
+            return sorted( self.Ordered( x ) for x in obj )
         else:
             return obj
 
-    def JsonCompare(self,SourceData,DestiData,FirstPara,SecondPara):
+    def JsonCompare( self, SourceData, DestiData, FirstPara, SecondPara ):
 
         try:
-            SourceCompareDataDic = json.loads(SourceData)
-            DestiCompareDataDic = json.loads(DestiData)
+            SourceCompareDataDic = json.loads( SourceData )
+            DestiCompareDataDic = json.loads( DestiData )
         except ValueError:
             print "SourceData or DestData is not JSON Type!"
             return False
 
         try:
-            Socom = SourceCompareDataDic[FirstPara][SecondPara]
-            Decom = DestiCompareDataDic[FirstPara][SecondPara]
-        except KeyError,error:
-            print "Key error ,This key is not found:%s"%error
+            Socom = SourceCompareDataDic[ FirstPara ][ SecondPara ]
+            Decom = DestiCompareDataDic[ FirstPara ][ SecondPara ]
+        except KeyError as error:
+            print "Key error ,This key is not found:%s" % error
             return False
 
-        if str(Socom).lower()== str(Decom).lower():
+        if str( Socom ).lower() == str( Decom ).lower():
             return True
         else:
-            print "Source Compare data:"+FirstPara+"."+SecondPara+"="+str(Socom)
-            print "Dest Compare data: "+FirstPara+"."+SecondPara+"="+str(Decom)
+            print "Source Compare data:" + FirstPara + "." + SecondPara + "=" + str( Socom )
+            print "Dest Compare data: " + FirstPara + "." + SecondPara + "=" + str( Decom )
             return False
 
-class SubnetData(NetworkData):
 
-    def __init__(self):
+class SubnetData( NetworkData ):
+
+    def __init__( self ):
         self.id = ''
         self.tenant_id = ''
         self.network_id = ''
@@ -101,59 +103,60 @@
         self.shared = False
         self.name = 'demo-subnet'
 
-    def DictoJson(self):
-        if self.id =='' or self.tenant_id == '':
+    def DictoJson( self ):
+        if self.id == '' or self.tenant_id == '':
             print 'Id and tenant id is necessary!'
 
         Dicdata = {}
         host_routesdata = []
-        host_routesdata.append({'nexthop': self.nexthop,'destination': self.destination})
+        host_routesdata.append( { 'nexthop': self.nexthop, 'destination': self.destination } )
         allocation_pools = []
-        allocation_pools.append({'start': self.start,'end':self.end})
+        allocation_pools.append( { 'start': self.start, 'end': self.end } )
 
         if self.id != '':
-            Dicdata['id'] = self.id
+            Dicdata[ 'id' ] = self.id
         if self.network_id != '':
-            Dicdata['network_id'] = self.network_id
+            Dicdata[ 'network_id' ] = self.network_id
         if self.name != '':
-            Dicdata['name'] = self.name
+            Dicdata[ 'name' ] = self.name
         if self.nexthop != '':
-            Dicdata['host_routes'] = host_routesdata
+            Dicdata[ 'host_routes' ] = host_routesdata
         if self.tenant_id != '':
-            Dicdata['tenant_id'] = self.tenant_id
+            Dicdata[ 'tenant_id' ] = self.tenant_id
         if self.start != '':
-            Dicdata['allocation_pools'] = allocation_pools
+            Dicdata[ 'allocation_pools' ] = allocation_pools
         if self.shared != '':
-            Dicdata['shared'] = self.shared
+            Dicdata[ 'shared' ] = self.shared
         if self.ipv6_address_mode != '':
-            Dicdata['ipv6_address_mode'] = self.ipv6_address_mode
+            Dicdata[ 'ipv6_address_mode' ] = self.ipv6_address_mode
         if self.ipv6_ra_mode != '':
-            Dicdata['ipv6_ra_mode'] = self.ipv6_ra_mode
+            Dicdata[ 'ipv6_ra_mode' ] = self.ipv6_ra_mode
         if self.cidr != '':
-            Dicdata['cidr'] = self.cidr
+            Dicdata[ 'cidr' ] = self.cidr
         if self.enable_dhcp != '':
-            Dicdata['enable_dhcp'] = self.enable_dhcp
+            Dicdata[ 'enable_dhcp' ] = self.enable_dhcp
         if self.dns_nameservers != '':
-            Dicdata['dns_nameservers'] = self.dns_nameservers
+            Dicdata[ 'dns_nameservers' ] = self.dns_nameservers
         if self.gateway_ip != '':
-            Dicdata['gateway_ip'] = self.gateway_ip
+            Dicdata[ 'gateway_ip' ] = self.gateway_ip
         if self.ip_version != '':
-            Dicdata['ip_version'] = self.ip_version
+            Dicdata[ 'ip_version' ] = self.ip_version
 
-        Dicdata = {'subnet': Dicdata}
+        Dicdata = { 'subnet': Dicdata }
 
-        return json.dumps(Dicdata,indent=4)
+        return json.dumps( Dicdata, indent=4 )
 
-class VirtualPortData(NetworkData):
 
-    def __init__(self):
+class VirtualPortData( NetworkData ):
+
+    def __init__( self ):
         self.id = ''
         self.state = 'ACTIVE'
         self.bindingHostId = 'fa:16:3e:76:8e:88'
-        self.allowedAddressPairs = [{'mac_address':'fa:16:3e:76:8e:88','ip_address':'192.168.1.1'}]
+        self.allowedAddressPairs = [ { 'mac_address': 'fa:16:3e:76:8e:88', 'ip_address': '192.168.1.1' } ]
         self.deviceOwner = 'none'
         self.fixedIp = []
-        self.securityGroups = [{'securityGroup':'asd'}]
+        self.securityGroups = [ { 'securityGroup': 'asd' } ]
         self.adminStateUp = True
         self.network_id = ''
         self.tenant_id = ''
@@ -165,48 +168,48 @@
         self.deviceId = 'a08aa'
         self.name = 'u'
 
-    def DictoJson(self):
+    def DictoJson( self ):
         if self.id == '' or self.tenant_id == ' ' or \
            self.network_id == '' or self.subnet_id == '':
             print 'Id/tenant id/networkid/subnetId is necessary!'
 
         Dicdata = {}
-        fixedIp =[]
-        fixedIp.append({'subnet_id':self.subnet_id,'ip_address':'192.168.1.4'})
+        fixedIp = []
+        fixedIp.append( { 'subnet_id': self.subnet_id, 'ip_address': '192.168.1.4' } )
         allocation_pools = []
 
         if self.id != '':
-            Dicdata['id'] = self.id
+            Dicdata[ 'id' ] = self.id
         if self.state != '':
-            Dicdata['status'] = self.state
+            Dicdata[ 'status' ] = self.state
         if self.bindingHostId != '':
-            Dicdata['binding:host_id'] = self.bindingHostId
+            Dicdata[ 'binding:host_id' ] = self.bindingHostId
         if self.allowedAddressPairs != '':
-            Dicdata['allowed_address_pairs'] = self.allowedAddressPairs
+            Dicdata[ 'allowed_address_pairs' ] = self.allowedAddressPairs
         if self.deviceOwner != '':
-            Dicdata['device_owner'] = self.deviceOwner
+            Dicdata[ 'device_owner' ] = self.deviceOwner
         if self.securityGroups != '':
-            Dicdata['security_groups'] = self.securityGroups
+            Dicdata[ 'security_groups' ] = self.securityGroups
         if self.adminStateUp != '':
-            Dicdata['admin_state_up'] = self.adminStateUp
+            Dicdata[ 'admin_state_up' ] = self.adminStateUp
         if self.network_id != '':
-            Dicdata['network_id'] = self.network_id
+            Dicdata[ 'network_id' ] = self.network_id
         if self.tenant_id != '':
-            Dicdata['tenant_id'] = self.tenant_id
+            Dicdata[ 'tenant_id' ] = self.tenant_id
         if self.bindingvifDetails != '':
-            Dicdata['binding:vif_details'] = self.bindingvifDetails
+            Dicdata[ 'binding:vif_details' ] = self.bindingvifDetails
         if self.bindingvnicType != '':
-            Dicdata['binding:vnic_type'] = self.bindingvnicType
+            Dicdata[ 'binding:vnic_type' ] = self.bindingvnicType
         if self.bindingvifType != '':
-            Dicdata['binding:vif_type'] = self.bindingvifType
+            Dicdata[ 'binding:vif_type' ] = self.bindingvifType
         if self.macAddress != '':
-            Dicdata['mac_address'] = self.macAddress
+            Dicdata[ 'mac_address' ] = self.macAddress
         if self.deviceId != '':
-            Dicdata['device_id'] = self.deviceId
+            Dicdata[ 'device_id' ] = self.deviceId
         if self.name != '':
-            Dicdata['name'] = self.name
+            Dicdata[ 'name' ] = self.name
 
-        Dicdata['fixed_ips'] = fixedIp
-        Dicdata = {'port': Dicdata}
+        Dicdata[ 'fixed_ips' ] = fixedIp
+        Dicdata = { 'port': Dicdata }
 
-        return json.dumps(Dicdata,indent=4)
+        return json.dumps( Dicdata, indent=4 )
