projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix vim-update by using PUT and proper handling of SDN info
[osm/osmclient.git]
/
osmclient
/
sol005
/
sdncontroller.py
diff --git
a/osmclient/sol005/sdncontroller.py
b/osmclient/sol005/sdncontroller.py
index
0639559
..
04b0775
100644
(file)
--- a/
osmclient/sol005/sdncontroller.py
+++ b/
osmclient/sol005/sdncontroller.py
@@
-48,20
+48,26
@@
class SdnController(object):
def update(self, name, sdn_controller):
sdnc = self.get(name)
def update(self, name, sdn_controller):
sdnc = self.get(name)
- http_code, resp = self._http.p
atch
_cmd(endpoint='{}/{}'.format(self._apiBase,sdnc['_id']),
+ http_code, resp = self._http.p
ut
_cmd(endpoint='{}/{}'.format(self._apiBase,sdnc['_id']),
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 http_code == 202:
print 'Deletion in progress'
#print 'RESP: {}'.format(resp)
if http_code == 202:
print 'Deletion in progress'