fix bug in vim-create with config
[osm/osmclient.git] / osmclient / sol005 / ns.py
index 30bbe02..9ce1fcd 100644 (file)
@@ -74,9 +74,15 @@ class Ns(object):
             return resp
         raise NotFound("ns {} not found".format(name))
 
-    def delete(self, name):
+    def delete(self, name, force=False):
         ns = self.get(name)
-        http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,ns['_id']))
+        querystring = ''
+        if force:
+            querystring = '?FORCE=True'
+        http_code, resp = self._http.delete_cmd('{}/{}{}'.format(self._apiBase,
+                                         ns['_id'], querystring))
+        if resp:
+            resp = json.loads(resp)
         #print 'RESP: {}'.format(resp)
         if http_code == 202:
             print 'Deletion in progress'