return http_code,data tuple in DELETE operations for sol005 client
[osm/osmclient.git] / osmclient / sol005 / nsd.py
index 3288e95..dac0adc 100644 (file)
@@ -91,9 +91,11 @@ class Nsd(object):
 
     def delete(self, name):
         nsd = self.get(name)
-        resp = self._http.delete_cmd('{}/{}'.format(self._apiBase, nsd['_id']))
-        #print 'RESP: '.format(resp)
-        if resp is None:
+        http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase, nsd['_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 nsd {}: {}".format(name, resp))