Merge "Fix pep8 violations in util"
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 17 Mar 2015 03:32:10 +0000 (03:32 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 17 Mar 2015 03:32:10 +0000 (03:32 +0000)
test/tools/odl-mdsal-clustering-tests/clustering-functional-test/util.py

index 445b5860f683d0e6ba54e67ee8e5737056b81c90..1c81235c691865b1f75c21970931c198edbf9b9a 100644 (file)
@@ -6,14 +6,11 @@ __email__ = "syedbahm@cisco.com"
 
 import requests
 
-#
-#Helps in making GET REST calls
-#
 
 def get(url, userId, password):
-
+    """Helps in making GET REST calls"""
     headers = {}
-    headers['Accept']= 'application/xml'
+    headers['Accept'] = 'application/xml'
 
     # Send the GET request
     req = requests.get(url, None, headers)
@@ -21,42 +18,35 @@ def get(url, userId, password):
     # Read the response
     return req
 
-#
-#Helps in making POST REST calls without outputs
-#
-def nonprintpost(url, userId, password,data):
 
+def nonprintpost(url, userId, password, data):
+    """Helps in making POST REST calls without outputs"""
     headers = {}
     headers['Content-Type'] = 'application/json'
-    #headers['Accept']= 'application/xml'
-
-    resp = requests.post(url,data.encode(),headers=headers)
+    # headers['Accept']= 'application/xml'
 
+    resp = requests.post(url, data.encode(), headers=headers)
 
     return resp
 
-#
-#Helps in making POST REST calls
-#
-def post(url, userId, password,data):
-    print("post request with url "+url)
-    print("post request with data "+data)
+
+def post(url, userId, password, data):
+    """Helps in making POST REST calls"""
+    print("post request with url " + url)
+    print("post request with data " + data)
     headers = {}
     headers['Content-Type'] = 'application/json'
-    #headers['Accept']= 'application/xml'
+    # headers['Accept']= 'application/xml'
 
-    resp = requests.post(url,data.encode(),headers=headers)
+    resp = requests.post(url, data.encode(), headers=headers)
 
-    #print (resp.raise_for_status())
-    print (resp.headers)
+    # print (resp.raise_for_status())
+    print(resp.headers)
 
     return resp
 
-#
-#Helps in making DELET REST calls
-#
-def delete(url,userId,password):
-    print("delete all resources belonging to url"+url)
-    resp=requests.delete(url)
-
 
+def delete(url, userId, password):
+    """Helps in making DELET REST calls"""
+    print("delete all resources belonging to url" + url)
+    resp = requests.delete(url)  # noqa