]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: Correct the return codes for the health check feature
authorroot <root@ceph-node1.homeoffice.wal-mart.com>
Tue, 21 Feb 2017 11:03:29 +0000 (16:33 +0530)
committerroot <root@ceph-node1.homeoffice.wal-mart.com>
Wed, 1 Mar 2017 06:19:24 +0000 (11:49 +0530)
Fixes: http://tracker.ceph.com/issues/19025
Signed-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>
src/rgw/rgw_op.cc

index 6cf90893320803523c05f09bb9d2e067428fd857..fa143e84d307d929b874e1a030ce620db523d5f8 100644 (file)
@@ -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 */
   }