From: root Date: Tue, 21 Feb 2017 11:03:29 +0000 (+0530) Subject: rgw: Correct the return codes for the health check feature X-Git-Tag: v12.0.1~223^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13557%2Fhead;p=ceph.git rgw: Correct the return codes for the health check feature Fixes: http://tracker.ceph.com/issues/19025 Signed-off-by: Pavan Rallabhandi --- 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 */ }