summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-10-06 05:33:31 -0400
committerKotresh HR <khiremat@redhat.com>2017-10-06 05:42:08 -0400
commit938addeb7ec634e431c2c8c0a768a2a9ed056c0d (patch)
tree92462163d4c855299939f8f5ef0cdfb7b50f79f1
parent12cfc1983fa1521d6da94ad488145182cf97db2c (diff)
geo-rep/scheduler: Add validation for session existence
Added validation to check for session existence to give out proper error message out. Change-Id: I13c5f6ef29c1395cff092a14e1bd2c197a39f058 BUG: 1499159 Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c2
-rw-r--r--extras/geo-rep/schedule_georep.py.in4
2 files changed, 5 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 2b15813..d6199b4 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -5854,7 +5854,7 @@ gf_cli_gsync_status_output (dict_t *dict, gf_boolean_t is_detail)
gf_log ("cli", GF_LOG_INFO, "%s", errmsg);
cli_out ("%s", errmsg);
- ret = 0;
+ ret = -1;
goto out;
}
diff --git a/extras/geo-rep/schedule_georep.py.in b/extras/geo-rep/schedule_georep.py.in
index 2ae0f10..1887fe7 100644
--- a/extras/geo-rep/schedule_georep.py.in
+++ b/extras/geo-rep/schedule_georep.py.in
@@ -468,6 +468,10 @@ if __name__ == "__main__":
if args.no_color:
USE_CLI_COLOR = False
try:
+ # Check for session existence
+ cmd = ["@SBIN_DIR@/gluster", "volume", "geo-replication",
+ args.mastervol, "%s::%s" % (args.slave, args.slavevol), "status"]
+ execute(cmd)
main(args)
except KeyboardInterrupt:
output_notok("Exiting...")