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