resp.content->resp.text in Should Contain
[integration/test.git] / csit / libraries / ScaleClient.py
index d7ef8ec82893e75e365eb43c452ecabd4f1ab606..10ec961d6e009c7a2898f6d69235b37adb2c2928 100644 (file)
@@ -141,7 +141,7 @@ def _randomize(spread, maxn):
     while True:
         if spread == 'gauss':
             ga = abs(random.gauss(0, 1))
-            rv = int(ga*float(maxn)/3)
+            rv = int(ga * float(maxn) / 3)
             if rv < maxn:
                 return rv
         elif spread == 'linear':
@@ -160,7 +160,7 @@ def generate_new_flow_details(flows=10, switches=1, swspread='gauss', tables=250
     It also returns a dictionary with statsistics."""
     swflows = [_randomize(swspread, switches) for f in range(int(flows))]
     # we have to increse the switch index because mininet start indexing switches from 1 (not 0)
-    fltables = [(s+1, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
+    fltables = [(s + 1, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
     notes = _get_notes(fltables)
     return fltables, notes
 
@@ -647,7 +647,6 @@ def flow_stats_collected(controller=''):
     Returns:
         :returns (switches, flows_reported, flows-found): tupple with counts of switches, reported and found flows
     """
-    # print type(flow_details), flow_details
     active_flows = 0
     found_flows = 0
     switches = _get_operational_inventory_of_switches(controller)
@@ -659,7 +658,7 @@ def flow_stats_collected(controller=''):
             active_flows += t['opendaylight-flow-table-statistics:flow-table-statistics']['active-flows']
             if 'flow' in t:
                 found_flows += len(t['flow'])
-    print "Switches,ActiveFlows(reported)/FlowsFound", len(switches), active_flows, found_flows
+    print("Switches,ActiveFlows(reported)/FlowsFound", len(switches), active_flows, found_flows)
     return len(switches), active_flows, found_flows