return http_code,data tuple in DELETE operations for sol005 client
[osm/osmclient.git] / osmclient / sol005 / http.py
index 11ddca6..20593b8 100644 (file)
@@ -48,16 +48,11 @@ class Http(http.Http):
         http_code = curl_cmd.getinfo(pycurl.HTTP_CODE)
         #print 'HTTP_CODE: {}'.format(http_code)
         curl_cmd.close()
-        if http_code == 204:
-            return None
-        elif http_code == 404:
-            if data.getvalue():
-                return json.loads(data.getvalue().decode())
-            else:
-                return "NOT FOUND"
+        # TODO 202 accepted should be returned somehow
         if data.getvalue():
-            return json.loads(data.getvalue().decode())
-        return "Failed"
+            return http_code, json.loads(data.getvalue().decode())
+        else:
+            return http_code, None
 
     def send_cmd(self, endpoint='', postfields_dict=None,
                  formfile=None, filename=None,