From 476c6284eac93239e3aaf986a6bcdd3628b95fb0 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 9 Jan 2014 00:58:06 +0000 Subject: glusterd: Keeping snapshot delete error messages consistent with that of vol delete. Change-Id: I5056c0e46015278bd8d0c39307e4671fd4259961 Signed-off-by: Avra Sengupta --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index acc8bef16..1d6da16e5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -3417,7 +3417,7 @@ glusterd_handle_snapshot_remove (rpcsvc_request_t *req, glusterd_op_t op, cg = glusterd_find_snap_cg_by_name (conf, cgname); if (NULL == cg) { - snprintf (err_str, len, "CG %s not found", cgname); + snprintf (err_str, len, "CG %s does not exist", cgname); gf_log (this->name, GF_LOG_WARNING, "%s", err_str); ret = -1; goto out; @@ -3504,7 +3504,7 @@ glusterd_snapshot_remove_prevalidate (dict_t *dict, char **op_errstr, cg = glusterd_find_snap_cg_by_name (conf, name); if (!cg) { snprintf (err_str, sizeof (err_str), "consistency group" - "%s is not found", name); + "%s does not exist", name); gf_log (this->name, GF_LOG_ERROR, "%s", err_str); *op_errstr = gf_strdup (err_str); goto out; @@ -3545,9 +3545,10 @@ glusterd_snapshot_remove_prevalidate (dict_t *dict, char **op_errstr, } ret = glusterd_volinfo_find (volname, &volinfo); if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "failed to get the volinfo for " - "the volume %s", volname); + snprintf (err_str, sizeof (err_str), "Volume %s does " + "not exist", volname); + gf_log (this->name, GF_LOG_ERROR, "%s", err_str); + *op_errstr = gf_strdup (err_str); goto out; } ret = dict_get_str (dict, "snapname", &name); @@ -3559,8 +3560,8 @@ glusterd_snapshot_remove_prevalidate (dict_t *dict, char **op_errstr, snap = glusterd_find_snap_by_name (volinfo, name); if (!snap) { ret = -1; - snprintf (err_str, sizeof (err_str), "snap %s is not " - "found", name); + snprintf (err_str, sizeof (err_str), "snap %s does " + "not exist", name); gf_log (this->name, GF_LOG_ERROR, "%s, (volume: %s)", err_str, volinfo->volname); *op_errstr = gf_strdup (err_str); -- cgit