summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-04-16 19:31:44 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-17 06:26:15 -0700
commit0049c2405aa39fe4ef299bd646e7a53e40753039 (patch)
treedd3add3ff1cc354c0434b98e9decac9a03b8428b /xlators/mgmt/glusterd/src/glusterd-geo-rep.c
parent79620e8f63148b1ad7d8180da46176a759435590 (diff)
glusterd : Fixes for breakages caused by volume-id validation
Fixes glusterd_op_build_payload() to, 1. take account of status cmd type when building payload for "volume status" to prevent "volume status all" from failing. 2. take account of volname being "help/help-xml" in volume set to prevent "volume set help/help-xml" from failing 3. obtain volname using key "master" prevent "volume geo-replication" commands from failing Also, fails op and sets correct op_errstr if volume not found during glusterd_dict_set_volid(), to make sure cli displays proper message. Change-Id: I40ded15c50b54a82ee61bf6d6e9d07f571679c8c BUG: 812801 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3157 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 5e12e19961f..4dc9396668d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -987,7 +987,7 @@ glusterd_verify_gsync_status_opts (dict_t *dict, char **op_errstr)
}
-static int
+int
glusterd_op_gsync_args_get (dict_t *dict, char **op_errstr,
char **master, char **slave)
{
@@ -995,21 +995,23 @@ glusterd_op_gsync_args_get (dict_t *dict, char **op_errstr,
int ret = -1;
GF_ASSERT (dict);
GF_ASSERT (op_errstr);
- GF_ASSERT (master);
- GF_ASSERT (slave);
- ret = dict_get_str (dict, "master", master);
- if (ret < 0) {
- gf_log ("", GF_LOG_WARNING, "master not found");
- *op_errstr = gf_strdup ("master not found");
- goto out;
+ if (master) {
+ ret = dict_get_str (dict, "master", master);
+ if (ret < 0) {
+ gf_log ("", GF_LOG_WARNING, "master not found");
+ *op_errstr = gf_strdup ("master not found");
+ goto out;
+ }
}
- ret = dict_get_str (dict, "slave", slave);
- if (ret < 0) {
- gf_log ("", GF_LOG_WARNING, "slave not found");
- *op_errstr = gf_strdup ("slave not found");
- goto out;
+ if (slave) {
+ ret = dict_get_str (dict, "slave", slave);
+ if (ret < 0) {
+ gf_log ("", GF_LOG_WARNING, "slave not found");
+ *op_errstr = gf_strdup ("slave not found");
+ goto out;
+ }
}