From 21eabe9bae81b3cc732fcf773fb5c1995f19d0d7 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 22 Sep 2011 10:12:24 +0200 Subject: geo-rep: add support to glob patterns with "geo-rep config" Change-Id: I0d54cea72e4363eab85ade774cc918081d8036e9 BUG: 3610 Reviewed-on: http://review.gluster.com/489 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 19975a68..eae5dd82 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -484,6 +484,7 @@ gsync_verify_config_options (dict_t *dict, char **op_errstr) char *slave = NULL; char *op_name = NULL; char *op_value = NULL; + char *t = NULL; gf_boolean_t banned = _gf_true; if (dict_get_str (dict, "subop", &subop) != 0) { @@ -517,13 +518,16 @@ gsync_verify_config_options (dict_t *dict, char **op_errstr) if (strcmp (subop, "get") == 0) return 0; - if (strcmp (subop, "set") != 0 && strcmp (subop, "del") != 0) { + t = strtail (subop, "set"); + if (!t) + t = strtail (subop, "del"); + if (!t || (t[0] && strcmp (t, "-glob") != 0)) { gf_log ("", GF_LOG_WARNING, "unknown subop %s", subop); *op_errstr = gf_strdup ("Invalid config request"); return -1; } - if (strcmp (subop, "set") == 0 && + if (strtail (subop, "set") && dict_get_str (dict, "op_value", &op_value) != 0) { gf_log ("", GF_LOG_WARNING, "missing value for set"); *op_errstr = gf_strdup ("missing value"); @@ -1105,7 +1109,7 @@ glusterd_gsync_configure (glusterd_volinfo_t *volinfo, char *slave, if (ret != 0) goto out; - if (strcmp (subop, "set") == 0) { + if (strtail (subop, "set")) { ret = dict_get_str (dict, "op_value", &op_value); if (ret != 0) goto out; -- cgit