]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Correct the return codes for the health check feature 13865/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:06:41 +0000 (15:06 +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 d1431f5b3d3d8cda1715d29d65f456a8f9138492..3ff940ea43a797876b6f3ca28fe9f1255134b1d9 100644 (file)
@@ -4402,9 +4402,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 */
   }