projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new --force option for xxx-delete commands in sol005 client
[osm/osmclient.git]
/
osmclient
/
sol005
/
vim.py
diff --git
a/osmclient/sol005/vim.py
b/osmclient/sol005/vim.py
index
dca8444
..
ec1ccad
100644
(file)
--- a/
osmclient/sol005/vim.py
+++ b/
osmclient/sol005/vim.py
@@
-90,11
+90,15
@@
class Vim(object):
return vim['uuid']
raise NotFound("vim {} not found".format(name))
return vim['uuid']
raise NotFound("vim {} not found".format(name))
- def delete(self, vim_name):
+ def delete(self, vim_name
, force=False
):
vim_id = vim_name
if not utils.validate_uuid4(vim_name):
vim_id = self.get_id(vim_name)
vim_id = vim_name
if not utils.validate_uuid4(vim_name):
vim_id = self.get_id(vim_name)
- http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,vim_id))
+ querystring = ''
+ if force:
+ querystring = '?FORCE=True'
+ http_code, resp = self._http.delete_cmd('{}/{}{}'.format(self._apiBase,
+ vim_id, querystring))
if resp:
resp = json.loads(resp)
#print 'RESP: {}'.format(resp)
if resp:
resp = json.loads(resp)
#print 'RESP: {}'.format(resp)