]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Correct the return codes for the health check feature 13866/head
authorroot <root@ceph-node1.homeoffice.wal-mart.com>
Tue, 21 Feb 2017 11:03:29 +0000 (16:33 +0530)
committerNathan Cutler <ncutler@suse.com>
Wed, 8 Mar 2017 14:08:08 +0000 (15:08 +0100)
Fixes: http://tracker.ceph.com/issues/19025
Signed-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>
(cherry picked from commit 4da2bf310f6d43423554c32e43ebf90ad2c3f3a9)

src/rgw/rgw_op.cc

index 5eaf0e9981d0edae946655ebebdb6a6374618a8c..e76b9be1f261ad304b13142352d2ab64e35039a5 100644 (file)
@@ -5200,9 +5200,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 */
   }