summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
authorVitalii Koriakov <vkoriako@redhat.com>2018-08-30 13:57:43 +0300
committerVitalii Koriakov <vkoriako@redhat.com>2018-08-30 14:09:58 +0300
commit349ef49743d06a6bb76abc88fc1159da3116a887 (patch)
tree5dbc6df21ebe30d6c7b371678cece821215c4fa5 /glustolibs-gluster/glustolibs/gluster
parente5c261bdffe069ff2b50b94f16d8dc3341d2657f (diff)
Adding is_brick_mux_disabled method
Change-Id: I2b5e8cb9d02967736f18ed80c1aaff48ac684716 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rwxr-xr-x[-rw-r--r--]glustolibs-gluster/glustolibs/gluster/brickmux_ops.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
index 0a88d4b..4e528f0 100644..100755
--- a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
@@ -31,7 +31,7 @@ def is_brick_mux_enabled(mnode):
mnode (str): Node on which cmd has to be executed.
Returns:
- bool : True if successfully enabled brickmux. False otherwise.
+ bool : True if brickmux is enabled. False otherwise.
"""
cmd = ("gluster v get all all | grep cluster.brick-multiplex |"
"awk '{print $2}'")
@@ -41,6 +41,23 @@ def is_brick_mux_enabled(mnode):
return False
+def is_brick_mux_disabled(mnode):
+ """Checks for brick multiplex operation is disabled
+
+ Args:
+ mnode (str): Node on which cmd has to be executed.
+
+ Returns:
+ bool : True if brickmux is disabled. False otherwise.
+ """
+ cmd = ("gluster v get all all | grep cluster.brick-multiplex |"
+ "awk '{print $2}'")
+ _, out, _ = g.run(mnode, cmd)
+ if "disabled" in out:
+ return True
+ return False
+
+
def enable_brick_mux(mnode):
"""Enables brick multiplex operation on all servers