Fix the flows number problem

Change-Id: I4e4eb9ffa92dd12a05dae21563228ed58046f3c1
diff --git a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index a5fb104..a8fde2f 100644
--- a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -402,6 +402,8 @@
         offtmp = 0
         main.step( "Pushing intents" )
         stepResult = main.TRUE
+        # temp variable to contain the number of flows
+        flowsNum = 0
 
         for i in range(limit):
 
@@ -432,10 +434,6 @@
             offfset = offfset + main.batchSize
 
             totalIntents = main.batchSize * main.numCtrls + totalIntents
-
-            # Contain the previous Flows
-            tempFlowsList = []
-
             if totalIntents >= main.minIntents and totalIntents % main.checkInterval == 0:
                 # if reach to minimum number and check interval, verify Intetns and flows
                 time.sleep( main.verifySleep * main.numCtrls )
@@ -481,8 +479,10 @@
                     temp = 0
                     flowsStateCount = []
                     flowsState = json.loads( main.ONOSrest1.flows() )
-                    if ( len(flowsState) < len(tempFlowsList) ):
-                        tempFlowsList = flowsState
+                    main.log.info("Total flows now: {}".format(len(flowsState)))
+                    if ( flowsNum < len(flowsState) ):
+                        flowsNum = len(flowsState)
+                    print(flowsNum)
                     for f in flowsState:
                         # get PENDING_ADD flows
                         if f.get("state") == "PENDING_ADD":
@@ -536,7 +536,7 @@
 
         # we need the total intents before crash
         totalIntents = len(intentsState)
-        totalFlows = len(flowsState)
+        totalFlows = flowsNum
 
         main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
         main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )