from osmclient.common import utils
from osmclient.common import wait as WaitForStatus
+from osmclient.common.exceptions import ClientException
from osmclient.common.exceptions import NotFound
-from osmclient.common.exceptions import OsmHttpException
import json
import logging
if resp:
resp = json.loads(resp)
if not resp or 'id' not in resp:
- raise OsmHttpException('unexpected response from server - {}'.format(
+ raise ClientException('unexpected response from server - {}'.format(
resp))
if wait:
# Wait for status for SDNC instance creation
wait_id = sdnc_id_for_wait
# Wait for status for VI instance update
self._wait(wait_id)
- else:
- pass
+ # else:
+ # pass
#else:
# msg = ""
# if resp:
elif resp and 'result' in resp:
print('Deleted')
else:
- msg = ""
- if resp:
- try:
- msg = json.loads(resp)
- except ValueError:
- msg = resp
- raise OsmHttpException("failed to delete SDN controller {} - {}".format(name, msg))
+ msg = resp or ""
+ # if resp:
+ # try:
+ # msg = json.loads(resp)
+ # except ValueError:
+ # msg = resp
+ raise ClientException("failed to delete SDN controller {} - {}".format(name, msg))
def list(self, filter=None):
"""Returns a list of SDN controllers