X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fsdncontroller.py;h=35ad9ee2a569a70826015c2e2eb77acae42b485d;hb=12138cdda2fb241cb440b1224d4a3b2202107f35;hp=2a4d4092e27d75b9cace83bd534abea680452ccd;hpb=70d6f1843686f323ced68a253127fedde86a1c25;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/sdncontroller.py b/osmclient/sol005/sdncontroller.py index 2a4d409..35ad9ee 100644 --- a/osmclient/sol005/sdncontroller.py +++ b/osmclient/sol005/sdncontroller.py @@ -20,8 +20,8 @@ OSM SDN controller API handling 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 @@ -75,7 +75,7 @@ class SdnController(object): 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 @@ -106,8 +106,8 @@ class SdnController(object): 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: @@ -140,13 +140,13 @@ class SdnController(object): 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