Display original result for healthcheck instead of crafting one

This gives more information and has better compatibility

Change-Id: Ia05320dd72822f517f13ddc79fe55721114344f5
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
This commit is contained in:
Yujun Zhang
2017-07-21 14:32:39 +08:00
parent 6b70d6135e
commit e4587e85eb

View File

@@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from vitrageclient.exceptions import ClientException
class HealthCheck(object):
URL = 'healthcheck/'
@@ -24,13 +22,5 @@ class HealthCheck(object):
def get(self):
"""Get healthcheck result"""
try:
resp = self.api.get(self.URL)
except ClientException as e:
return {"passed": False,
"message": e.message,
"url": e.url,
"status_code": e.code}
return {"passed": resp.status_code == self.STATUS_CODE_OK,
"status_code": resp.status_code}
resp = self.api.get(self.URL)
return resp.json()