summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-09-19 21:15:31 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2020-01-03 09:08:05 +0000
commite6c1c5d7809494ced4f7273dac9784b3276c798e (patch)
treeb6d9b55c01d67f7b7efc634ee661c30682e9025f /glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
parent62aeeec189f145d521ebf719956a3fbc570af1ee (diff)
[lib] Adding more check functions and tarssh support
- Adding the following check functions: 1. is_passwordless_ssh_configured() - To check if passwordless ssh is configured or not between given nodes with a given user. 2. is_group_exists() - To check if group is present on servers or not. 3. is_user_exists() - To check if a given user is present on servers or not. - Adding functionality to support both sync methods. - Adding nonrootpass parameter to georep_prerequisites() as in the previous logic the password for the non-root and the root user were the same which might not always be the case. - Fixing georep_config_get() and georep_config_set() to take non-root user as well. Change-Id: I8a42d48d56690040dd7f78d1fb919029c0d6e61d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py')
-rwxr-xr-xglustolibs-gluster/glustolibs/gluster/geo_rep_ops.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py b/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
index 24161f6..7e12113 100755
--- a/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
@@ -233,7 +233,8 @@ def georep_create(mnode, mastervol, slaveip, slavevol, user=None, force=False):
return g.run(mnode, cmd)
-def georep_config_get(mnode, mastervol, slaveip, slavevol, config_key):
+def georep_config_get(mnode, mastervol, slaveip, slavevol, config_key,
+ user=None):
""" All the available configurable geo-rep options can be got
using the config_key and seeing what it has been set to
@@ -256,12 +257,17 @@ def georep_config_get(mnode, mastervol, slaveip, slavevol, config_key):
of the command execution.
"""
- cmd = ("gluster volume geo-replication %s %s::%s config %s" %
- (mastervol, slaveip, slavevol, config_key))
+ if user:
+ cmd = ("gluster volume geo-replication %s %s@%s::%s config %s" %
+ (mastervol, user, slaveip, slavevol, config_key))
+ else:
+ cmd = ("gluster volume geo-replication %s %s::%s config %s" %
+ (mastervol, slaveip, slavevol, config_key))
return g.run(mnode, cmd)
-def georep_config_set(mnode, mastervol, slaveip, slavevol, config, value):
+def georep_config_set(mnode, mastervol, slaveip, slavevol, config, value,
+ user=None):
""" All the available configurable geo-rep options can be set with a
specific command if required or
just with the config parameter
@@ -285,8 +291,12 @@ def georep_config_set(mnode, mastervol, slaveip, slavevol, config, value):
of the command execution.
"""
- cmd = ("gluster volume geo-replication %s %s::%s config %s %s" %
- (mastervol, slaveip, slavevol, config, value))
+ if user:
+ cmd = ("gluster volume geo-replication %s %s::%s config %s %s" %
+ (mastervol, user, slaveip, slavevol, config, value))
+ else:
+ cmd = ("gluster volume geo-replication %s %s::%s config %s %s" %
+ (mastervol, slaveip, slavevol, config, value))
return g.run(mnode, cmd)