From 98377f57923b2569818d76d9bb14460c15548968 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 24 May 2016 09:24:51 -0400 Subject: [PATCH] Fix print statements for pep8 "print (" -> "print(" to remove space between print function and parenthesis. Change-Id: Idab18bed943ab9f4f4896cedb99d219ad893e939 Signed-off-by: Thanh Ha --- csit/libraries/CrudLibrary.py | 4 +- csit/libraries/UtilLibrary.py | 4 +- .../clustering/cluster-tools/cluster_check.py | 38 +++++++++---------- .../clustering-functional-test/crud.py | 2 +- .../clustering-functional-test/util.py | 2 +- .../flow_add_delete_test.py | 2 +- .../flow_config_blaster.py | 2 +- .../inventory_perf.py | 2 +- .../inventory_read_blaster.py | 2 +- .../clustering-performance-test/odl_tester.py | 2 +- .../clustering-performance-test/onos_stats.py | 2 +- .../onos_tester.py | 2 +- .../shard_perf_test.py | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/csit/libraries/CrudLibrary.py b/csit/libraries/CrudLibrary.py index 5fdf77db23..b930d84afc 100644 --- a/csit/libraries/CrudLibrary.py +++ b/csit/libraries/CrudLibrary.py @@ -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) # diff --git a/csit/libraries/UtilLibrary.py b/csit/libraries/UtilLibrary.py index dcd3d662b4..1b2ead89ba 100644 --- a/csit/libraries/UtilLibrary.py +++ b/csit/libraries/UtilLibrary.py @@ -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) diff --git a/tools/clustering/cluster-tools/cluster_check.py b/tools/clustering/cluster-tools/cluster_check.py index 02695aea5a..23525dcb83 100755 --- a/tools/clustering/cluster-tools/cluster_check.py +++ b/tools/clustering/cluster-tools/cluster_check.py @@ -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") diff --git a/tools/odl-mdsal-clustering-tests/clustering-functional-test/crud.py b/tools/odl-mdsal-clustering-tests/clustering-functional-test/crud.py index 0e1f66a7cd..dabf6a4b5f 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-functional-test/crud.py +++ b/tools/odl-mdsal-clustering-tests/clustering-functional-test/crud.py @@ -207,7 +207,7 @@ def options(): usageString = usageString + command + param - print (usageString) + print(usageString) # diff --git a/tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py b/tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py index aa34bc0d2b..e1667dc48d 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py +++ b/tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py @@ -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 diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py index cc36ed93a7..b0ddcda3de 100755 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_add_delete_test.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py index 8b38b14b8f..cdf2d4207d 100755 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/flow_config_blaster.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_perf.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_perf.py index 289624ddd5..a10914bdec 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_perf.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_perf.py @@ -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) diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_read_blaster.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_read_blaster.py index eefe01fa42..87a19ebc85 100755 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_read_blaster.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/inventory_read_blaster.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/odl_tester.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/odl_tester.py index 84a92567a1..1b38833c4c 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/odl_tester.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/odl_tester.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py index 216610f4e2..9553badc0e 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_tester.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_tester.py index 913ea15486..555d36d1a8 100644 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_tester.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_tester.py @@ -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): diff --git a/tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py b/tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py index 6b631eaaf4..b8ecea65e4 100755 --- a/tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py +++ b/tools/odl-mdsal-clustering-tests/clustering-performance-test/shard_perf_test.py @@ -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): -- 2.36.6