summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
authorAkarsha <akrai@redhat.com>2018-03-28 13:43:20 +0530
committerNigel Babu <nigelb@redhat.com>2018-04-17 05:28:35 +0000
commit19972fa1c1241c1e87726893556815aa230d1d41 (patch)
treecc49e945f1a8482d5e36cb55a81bd3cde193b857 /glustolibs-gluster/glustolibs/gluster
parent6d1a0615f6d6f925a90ab508895809e42fa23bd9 (diff)
Adding function to enable brick mux
Change-Id: Id1396eb5211f1e189b603fcab916711dbceb30af Signed-off-by: Akarsha <akrai@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brickmux_ops.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
index af72a85..6f54808 100644
--- a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
@@ -38,3 +38,19 @@ def is_brick_mux_enabled(mnode):
return True
else:
return False
+
+
+def enable_brick_mux(mnode):
+ """Enables brick multiplex operation on all servers
+
+ Args:
+ mnode (str): Node on which cmd has to be executed.
+
+ Returns:
+ bool : True if successfully enabled brickmux. False otherwise.
+ """
+ cmd = ("gluster v set all cluster.brick-multiplex enable")
+ _, out, _ = g.run(mnode, cmd)
+ if "success" in out:
+ return True
+ return False