return http_code,data tuple in DELETE operations for sol005 client
[osm/osmclient.git] / osmclient / sol005 / ns.py
index 4b55cc2..590cdb1 100644 (file)
@@ -75,9 +75,11 @@ class Ns(object):
 
     def delete(self, name):
         ns = self.get(name)
-        resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,ns['_id']))
-        # print 'RESP: {}'.format(resp)
-        if resp is None:
+        http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,ns['_id']))
+        #print 'RESP: {}'.format(resp)
+        if http_code == 202:
+            print 'Deletion in progress'
+        elif http_code == 204:
             print 'Deleted'
         else:
             raise ClientException("failed to delete ns {}: {}".format(name, resp))