- if http_code in (200, 201, 202, 204):
- if resp:
- resp = json.loads(resp)
- if not resp or 'id' not in resp:
- raise ClientException('unexpected response from server - {}'.format(
- resp))
- if wait:
- # Wait for status for NS instance action
- # For the 'action' operation, 'id' is used
- self._wait(resp.get('id'))
- return resp['id']
- else:
- msg = ""
- if resp:
- try:
- msg = json.loads(resp)
- except ValueError:
- msg = resp
- raise ClientException(msg)
+ #if http_code in (200, 201, 202, 204):
+ if resp:
+ resp = json.loads(resp)
+ if not resp or 'id' not in resp:
+ raise ClientException('unexpected response from server - {}'.format(
+ resp))
+ if wait:
+ # Wait for status for NS instance action
+ # For the 'action' operation, 'id' is used
+ self._wait(resp.get('id'))
+ return resp['id']
+ #else:
+ # msg = ""
+ # if resp:
+ # try:
+ # msg = json.loads(resp)
+ # except ValueError:
+ # msg = resp
+ # raise ClientException(msg)