projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vim-update dealing with SDN controller and port mapping
[osm/osmclient.git]
/
osmclient
/
sol005
/
sdncontroller.py
diff --git
a/osmclient/sol005/sdncontroller.py
b/osmclient/sol005/sdncontroller.py
index
7833fbd
..
29b8f68
100644
(file)
--- a/
osmclient/sol005/sdncontroller.py
+++ b/
osmclient/sol005/sdncontroller.py
@@
-52,16
+52,20
@@
class SdnController(object):
postfields_dict=sdn_controller)
if resp:
resp = json.loads(resp)
postfields_dict=sdn_controller)
if resp:
resp = json.loads(resp)
- print 'RESP: {}'.format(resp)
+
#
print 'RESP: {}'.format(resp)
if not resp or 'id' not in resp:
raise ClientException('failed to update SDN controller: '.format(
resp))
else:
print resp['id']
if not resp or 'id' not in resp:
raise ClientException('failed to update SDN controller: '.format(
resp))
else:
print resp['id']
- def delete(self, name):
+ def delete(self, name
, force=False
):
sdn_controller = self.get(name)
sdn_controller = self.get(name)
- http_code, resp = self._http.delete_cmd('{}/{}'.format(self._apiBase,sdn_controller['_id']))
+ querystring = ''
+ if force:
+ querystring = '?FORCE=True'
+ http_code, resp = self._http.delete_cmd('{}/{}{}'.format(self._apiBase,
+ sdn_controller['_id'], querystring))
if resp:
resp = json.loads(resp)
#print 'RESP: {}'.format(resp)
if resp:
resp = json.loads(resp)
#print 'RESP: {}'.format(resp)