From 4da2bf310f6d43423554c32e43ebf90ad2c3f3a9 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Feb 2017 16:33:29 +0530 Subject: [PATCH] rgw: Correct the return codes for the health check feature Fixes: http://tracker.ceph.com/issues/19025 Signed-off-by: Pavan Rallabhandi --- src/rgw/rgw_op.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 6cf90893320..fa143e84d30 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5202,9 +5202,10 @@ void RGWListBucketMultiparts::execute() void RGWGetHealthCheck::execute() { - if (! g_conf->rgw_healthcheck_disabling_path.empty() && - ::access(g_conf->rgw_healthcheck_disabling_path.c_str(), F_OK )) { - op_ret = -ERR_SERVICE_UNAVAILABLE; + if (!g_conf->rgw_healthcheck_disabling_path.empty() && + (::access(g_conf->rgw_healthcheck_disabling_path.c_str(), F_OK) == 0)) { + /* Disabling path specified & existent in the filesystem. */ + op_ret = -ERR_SERVICE_UNAVAILABLE; /* 503 */ } else { op_ret = 0; /* 200 OK */ } -- 2.39.5