cb8e9e
From a12da1b2111c87e4da3faae6ac17acfc22c70dbc Mon Sep 17 00:00:00 2001
cb8e9e
From: Ashish Pandey <aspandey@redhat.com>
cb8e9e
Date: Tue, 16 Jun 2015 15:18:50 +0530
cb8e9e
Subject: [PATCH 188/190] glusterd: Correction in Error message for disperse volume create
cb8e9e
cb8e9e
 Problem: If all the bricks are on same server and
cb8e9e
 creating "disperse" volume without using "force",
cb8e9e
 it throws a failure message mentioning "replicate"
cb8e9e
 as volume.
cb8e9e
cb8e9e
 Solution: Adding failure message for disperse volume too
cb8e9e
 Review link for master -
cb8e9e
 http://review.gluster.org/11250/
cb8e9e
cb8e9e
Change-Id: I9e466b1fe9dae8cf556903b1a2c4f0b270159841
cb8e9e
BUG: 1223225
cb8e9e
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
cb8e9e
cb8e9e
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
cb8e9e
Change-Id: I490dad35caa13feec3000d061b48deff59a9cff4
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/51762
cb8e9e
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
cb8e9e
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
cb8e9e
---
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-volume-ops.c |    9 +++++++--
cb8e9e
 1 files changed, 7 insertions(+), 2 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
cb8e9e
index a65495d..2ad1614 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
cb8e9e
@@ -101,7 +101,7 @@ glusterd_check_brick_order(dict_t *dict, char *err_str)
cb8e9e
         const char      failed_string[2048] = "Failed to perform brick order "
cb8e9e
                                 "check. Use 'force' at the end of the command"
cb8e9e
                                 " if you want to override this behavior. ";
cb8e9e
-        const char      found_string[2048]  = "Multiple bricks of a replicate "
cb8e9e
+        const char      found_string[2048]  = "Multiple bricks of a %s "
cb8e9e
                                 "volume are present on the same server. This "
cb8e9e
                                 "setup is not optimal. Use 'force' at the "
cb8e9e
                                 "end of the command if you want to override "
cb8e9e
@@ -248,7 +248,12 @@ check_failed:
cb8e9e
 found_bad_brick_order:
cb8e9e
         gf_msg (this->name, GF_LOG_INFO, 0,
cb8e9e
                 GD_MSG_BAD_BRKORDER, "Bad brick order found");
cb8e9e
-        snprintf (err_str, sizeof (found_string), found_string);
cb8e9e
+        if (type == GF_CLUSTER_TYPE_DISPERSE) {
cb8e9e
+                snprintf (err_str, sizeof (found_string), found_string, "disperse");
cb8e9e
+        } else {
cb8e9e
+                snprintf (err_str, sizeof (found_string), found_string, "replicate");
cb8e9e
+        }
cb8e9e
+
cb8e9e
         ret = -1;
cb8e9e
 out:
cb8e9e
         ai_list_tmp2 = NULL;
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e