summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-06-18 03:54:36 -0400
committerNigel Babu <nigelb@redhat.com>2018-06-21 05:37:17 +0000
commit0b2576209bf35beed5393c4b33c7fd0441bf7412 (patch)
treecf8a6768253e6a5b568f2c359673a98e8cab2e3b /glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
parent26d7971f17a8c2965b7f3b9850b3998b34494af3 (diff)
Geo-rep: Non-root session related ops
Setting up mountbroker along with adding user and checking status. Setting pem keys specific to non-root Change-Id: Ic8e38087d118f43aea0da270ea8f8f9da81286c1 Signed-off-by: rallan <rallan@redhat.com> Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py97
1 files changed, 97 insertions, 0 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py b/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
index faf8187..e87090d 100644
--- a/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/geo_rep_ops.py
@@ -123,6 +123,103 @@ def georep_geoaccount(servers, groupname, groupaccount):
return True
+def georep_mountbroker_setup(mnode, groupname, directory):
+ """ Sets up mountbroker root directory and group
+
+ Args:
+ mnode (str): Node on which command is to be executed
+ groupname (str) : Specifies the groupname used
+ directory (str) : Specifies mountbroker root directory
+
+ Returns:
+ tuple: Tuple containing three elements (ret, out, err).
+ The first element 'ret' is of type 'int' and is the return value
+ of command execution.
+
+ The second element 'out' is of type 'str' and is the stdout value
+ of the command execution.
+
+ The third element 'err' is of type 'str' and is the stderr value
+ of the command execution.
+
+ """
+ cmd = "gluster-mountbroker setup %s %s" % (directory, groupname)
+ return g.run(mnode, cmd)
+
+
+def georep_mountbroker_adduser(mnode, slavevol, useraccount):
+ """ Adds the volume and user to the mountbroker
+
+ Args:
+ mnode (str): Node on which command is to be executed
+ slavevol (str) : The slave volume name
+ useraccount (str): The user with which geo-rep is to be set up
+
+ Returns:
+ tuple: Tuple containing three elements (ret, out, err).
+ The first element 'ret' is of type 'int' and is the return value
+ of command execution.
+
+ The second element 'out' is of type 'str' and is the stdout value
+ of the command execution.
+
+ The third element 'err' is of type 'str' and is the stderr value
+ of the command execution.
+
+ """
+ cmd = "gluster-mountbroker add %s %s" % (slavevol, useraccount)
+ return g.run(mnode, cmd)
+
+
+def georep_mountbroker_status(mnode):
+ """ Displays the status of every peer node in the slave cluster
+
+ Args:
+ mnode (str): Node on which command is to be executed
+
+
+ Returns:
+ tuple: Tuple containing three elements (ret, out, err).
+ The first element 'ret' is of type 'int' and is the return value
+ of command execution.
+
+ The second element 'out' is of type 'str' and is the stdout value
+ of the command execution.
+
+ The third element 'err' is of type 'str' and is the stderr value
+ of the command execution.
+
+ """
+ cmd = "gluster-mountbroker status"
+ return g.run(mnode, cmd)
+
+
+def georep_set_pemkeys(mnode, useraccount, mastervol, slavevol):
+ """ Sets geo-rep pem keys
+
+ Args:
+ mnode (str): Node on which command is to be executed
+ useraccount (str) : User with which geo-rep is to be set up
+ mastervol (str) : The master volume
+ slavevol (str): The slave volume
+
+ Returns:
+ tuple: Tuple containing three elements (ret, out, err).
+ The first element 'ret' is of type 'int' and is the return value
+ of command execution.
+
+ The second element 'out' is of type 'str' and is the stdout value
+ of the command execution.
+
+ The third element 'err' is of type 'str' and is the stderr value
+ of the command execution.
+
+ """
+ cmd = ("/usr/libexec/glusterfs/set_geo_rep_pem_keys.sh %s %s %s" %
+ (useraccount, mastervol, slavevol))
+ return g.run(mnode, cmd)
+
+
def georep_status(mnode, mastervol, slaveip, slavevol, user=None):
"""Shows the status of the geo-replication session
Args: