- _, resp = self._http.get2_cmd('{}/{}'.format(self._apiBase,cluster_id))
-# if not resp or '_id' not in resp:
-# raise ClientException('failed to get K8s cluster info: '.format(resp))
-# else:
- if resp:
- return json.loads(resp)
- raise NotFound("K8s cluster {} not found".format(name))
+ try:
+ _, resp = self._http.get2_cmd('{}/{}'.format(self._apiBase,cluster_id))
+ if resp:
+ resp = json.loads(resp)
+ if not resp or '_id' not in resp:
+ raise ClientException('failed to get K8s cluster info: {}'.format(resp))
+ return resp
+ except NotFound:
+ raise NotFound("K8s cluster {} not found".format(name))