diff options
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brickmux_ops.py')
-rwxr-xr-x[-rw-r--r--] | glustolibs-gluster/glustolibs/gluster/brickmux_ops.py | 19 |
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 0a88d4b22..4e528f09e 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 |