Fix print statements for pep8 49/39349/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 24 May 2016 13:24:51 +0000 (09:24 -0400)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 25 May 2016 21:44:26 +0000 (21:44 +0000)
"print (" -> "print(" to remove space between print function and
parenthesis.

Change-Id: Idab18bed943ab9f4f4896cedb99d219ad893e939
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
13 files changed:
csit/libraries/CrudLibrary.py
csit/libraries/UtilLibrary.py
tools/clustering/cluster-tools/cluster_check.py
tools/odl-mdsal-clustering-tests/clustering-functional-test/crud.py
tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_perf.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_read_blaster.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/odl_tester.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_tester.py
tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py

index 5fdf77db2336c7d7ebd1f4443098f3963765abbe..b930d84afc9bec7ceede06938e4e23659a95d95d 100644 (file)
@@ -192,7 +192,7 @@ def getCarPersonMappings(hostname, port, ignore):
     """
     resp = UtilLibrary.get(SettingsLibrary.getCarPersonUrl(hostname, port), "admin", "admin")
     resp.encoding = 'utf-8'
-    print (resp)
+    print(resp)
 
     return resp
 
@@ -297,7 +297,7 @@ def options():
 
     usageString = usageString + command + param
 
-    print (usageString)
+    print(usageString)
 
 
 #
index dcd3d662b4651b94223446f95c5a2aa9864e5a90..1b2ead89baf977a2572d098467f3ca8da430a188 100644 (file)
@@ -77,8 +77,8 @@ def post(url, userId, password, data):
     session = _cache.switch("CLUSTERING_POST")
     resp = session.post(url, data.encode('utf-8'), headers=headers, auth=(userId, password))
 
-    # print (resp.raise_for_status())
-    print (resp.headers)
+    # print(resp.raise_for_status())
+    print(resp.headers)
     if resp.status_code >= 500:
         print(resp.text)
 
index 02695aea5aaabdb178ed01e419f4c2eae643dc0f..23525dcb838554c90742cbe1f4f7711bc377cdce 100755 (executable)
@@ -33,16 +33,16 @@ def validate_cluster(ipaddress):
     try:
         resp = requests.get(url, headers=con_header, auth=authentication)
     except requests.exceptions.RequestException:
-        print ("controller is unreachable")
+        print("controller is unreachable")
         sys.exit(1)
 
     if resp.status_code == RESP_NOT_FOUND:
-        print ("jolokia not installed, resp code", resp.status_code)
-        print ("Problem with accessing jolokia")
+        print("jolokia not installed, resp code", resp.status_code)
+        print("Problem with accessing jolokia")
         sys.exit(1)
 
     elif resp.status_code != RESP_GET_SUCCESS:
-        print ("error in getting response, resp code", resp.status_code)
+        print("error in getting response, resp code", resp.status_code)
         sys.exit(1)
 
     data = json.loads(resp.content)
@@ -65,8 +65,8 @@ def validate_cluster(ipaddress):
                "type=DistributedOperationalDatastore"
         resp1 = requests.get(url1, headers=con_header, auth=authentication)
         if resp1.status_code != RESP_GET_SUCCESS:
-            print ("error in getting response for the node", ip)
-            print ("response content", resp1.content)
+            print("error in getting response for the node", ip)
+            print("response content", resp1.content)
             continue
         data2 = json.loads(resp1.content)
         member_role = data2['value']['MemberName']
@@ -77,11 +77,11 @@ def validate_cluster(ipaddress):
     for leader_node in member_list:
         address = leader_node.split('-')
         if address[0] == leaderNode:
-            print ("=================== Leader Node ======================\n")
-            print (leader_node)
+            print("=================== Leader Node ======================\n")
+            print(leader_node)
             member_list.remove(leader_node)
-            print ("=================== Follower Node ====================\n")
-            print (member_list)
+            print("=================== Follower Node ====================\n")
+            print(member_list)
     list_entity_owners(ipaddress, entity_owner_list)
 
 
@@ -95,30 +95,30 @@ def list_entity_owners(ipaddress, entity_owner_list):
     url = "http://" + ipaddress + entity
     resp = requests.get(url, headers=con_header, auth=authentication)
     if resp.status_code != RESP_GET_SUCCESS:
-        print ("controller is down, resp_code", resp.status_code)
-        print ("response content", resp.content)
+        print("controller is down, resp_code", resp.status_code)
+        print("response content", resp.content)
         sys.exit(1)
     data = json.loads(resp.content)
     ovsdb = data['entity-owners']['entity-type']
-    print ("\n\n=================== Entity Details ===================\n")
+    print("\n\n=================== Entity Details ===================\n")
     for e_type in ovsdb:
         entities = e_type['entity']
         for entity in entities:
             id = entity['id']
             if len(entity['owner']) > 0:
-                print ("NODE ID", str(id[id.rindex('=') + 2:len(id) - 2]))
-                print ("OWNER", str(entity['owner']))
+                print("NODE ID", str(id[id.rindex('=') + 2:len(id) - 2]))
+                print("OWNER", str(entity['owner']))
             for owner in entity_owner_list:
                 owner_role = owner.split(':')
                 if entity['owner'] == owner_role[1]:
-                    print ("IP Address", str(owner_role[0]))
-                    print ("\n")
+                    print("IP Address", str(owner_role[0]))
+                    print("\n")
 
 # Main Block
 if __name__ == '__main__':
-    print ('*****Cluster Status******')
+    print('*****Cluster Status******')
     ipaddress = raw_input("Please enter ipaddress to find Leader Node : ")
     validate_cluster(ipaddress)
 
 else:
-    print ("Cluster checker loaded as Module")
+    print("Cluster checker loaded as Module")
index 0e1f66a7cd7d12a8ebc9f9c2182d71a3b7418832..dabf6a4b5f956c8657c52e1ae8c9572c5282952d 100644 (file)
@@ -207,7 +207,7 @@ def options():
 
     usageString = usageString + command + param
 
-    print (usageString)
+    print(usageString)
 
 
 #
index aa34bc0d2ba802b56d4dff63fc2dbb8ba256f681..e1667dc48d9bee41d239a10ec6a01a161d55c696 100644 (file)
@@ -40,7 +40,7 @@ def post(url, userId, password, data):
 
     resp = requests.post(url, data.encode(), headers=headers)
 
-    # print (resp.raise_for_status())
+    # print(resp.raise_for_status())
     print(resp.headers)
 
     return resp
index cc36ed93a71f37e21a0a01e6e5a11f0499192d93..b0ddcda3def3a72c7144e4a6f7774eecc55a5812 100755 (executable)
@@ -26,7 +26,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 def wait_for_stats(crawler, exp_found, timeout, delay):
index 8b38b14b8fc89e81e599a2fe942e253a651be8b1..cdf2d4207d2cb5d21bc8235c47ea7ac04d5eba76 100755 (executable)
@@ -46,7 +46,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 class FlowConfigBlaster(object):
index 289624ddd5a4243b7400a258c2a23c6862b2a62c..a10914bdec725f57c309624d7745dbbaff8bd1af 100644 (file)
@@ -36,7 +36,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 # Initialize the totals over all threads
 total_requests = Counter(0)
index eefe01fa42be0a588d71706dabe4ad23126a85d9..87a19ebc85dc3c53907be59c332e1406866a180a 100755 (executable)
@@ -33,7 +33,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 def read(hosts, port, auth, datastore, print_lock, cycles, results_queue):
index 84a92567a1047160c490a279f50bd90cad094a73..1b38833c4cb718924bce87b2a7fd8b6e6adad743 100644 (file)
@@ -39,7 +39,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 class Counter(object):
index 216610f4e2774c51c2f412ee4bcde6c7c2b2d02a..9553badc0ecfb7085dee9187c379210c38204373 100644 (file)
@@ -52,7 +52,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 class Counter(object):
index 913ea15486daf0dc2349d51bb7bc9f484464b419..555d36d1a8fa57f661d1cb479d21aaa87cfefbde 100644 (file)
@@ -57,7 +57,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 class Counter(object):
index 6b631eaaf46249f66b669340457c63a849c4787c..b8ecea65e4f0991d328b4b1556019977a066f40b 100755 (executable)
@@ -42,7 +42,7 @@ class Timer(object):
         self.secs = self.end - self.start
         self.msecs = self.secs * 1000  # millisecs
         if self.verbose:
-            print ("elapsed time: %f ms" % self.msecs)
+            print("elapsed time: %f ms" % self.msecs)
 
 
 class ShardPerformanceTester(object):