summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py22
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brickmux_ops.py10
2 files changed, 13 insertions, 19 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brick_libs.py b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
index f3e18ec..67496b8 100644
--- a/glustolibs-gluster/glustolibs/gluster/brick_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
@@ -69,13 +69,11 @@ def get_all_bricks(mnode, volname):
"for the volume: %s", brick, volname)
return None
return all_bricks
- else:
- g.log.error("Bricks not found in Bricks section of volume "
- "info for the volume %s", volname)
- return None
- else:
- g.log.error("Bricks not found for the volume %s", volname)
+ g.log.error("Bricks not found in Bricks section of volume "
+ "info for the volume %s", volname)
return None
+ g.log.error("Bricks not found for the volume %s", volname)
+ return None
def get_hot_tier_bricks(mnode, volname):
@@ -199,7 +197,7 @@ def bring_bricks_offline(volname, bricks_list,
brick_node, brick_path = brick.split(":")
cmd = ("pgrep glusterfsd")
_, out, _ = g.run(brick_node, cmd)
- if(len(out.split()) > 1):
+ if len(out.split()) > 1:
cmd = ("ps -eaf | grep glusterfsd | "
" grep %s.%s | grep -o '/var/run/gluster/.*' | "
" awk '{ print $3 }' | grep -v 'awk' "
@@ -634,9 +632,7 @@ def select_tier_volume_bricks_to_bring_offline(mnode, volname):
(mnode, volname))
bricks_to_bring_offline['hot_tier_bricks'] = hot_tier_bricks
bricks_to_bring_offline['cold_tier_bricks'] = cold_tier_bricks
- return bricks_to_bring_offline
- else:
- return bricks_to_bring_offline
+ return bricks_to_bring_offline
def select_hot_tier_bricks_to_bring_offline(mnode, volname):
@@ -793,10 +789,8 @@ def get_bricks_to_bring_offline_from_replicated_volume(subvols_list,
"%s", quorum_info)
return list_of_bricks_to_bring_offline
- """
- offline_bricks_limit: Maximum Number of bricks that can be offline without
- affecting the cluster
- """
+ # offline_bricks_limit: Maximum Number of bricks that can be offline
+ # without affecting the cluster
if is_quorum_applicable:
if 'fixed' in quorum_type:
if quorum_count is None:
diff --git a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
index 2fa4687..3fcb4ee 100644
--- a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
@@ -20,7 +20,7 @@
"""
from glusto.core import Glusto as g
-from glustolibs.gluster.brick_libs import get_all_bricks
+import glustolibs.gluster.brick_libs
from glustolibs.gluster.volume_ops import get_volume_status
@@ -35,11 +35,10 @@ def is_brick_mux_enabled(mnode):
"""
cmd = ("gluster v get all all | grep cluster.brick-multiplex |"
"awk '{print $2}'")
- ret, out, err = g.run(mnode, cmd)
+ _, out, _ = g.run(mnode, cmd)
if "enable" in out:
return True
- else:
- return False
+ return False
def enable_brick_mux(mnode):
@@ -72,7 +71,8 @@ def check_brick_pid_matches_glusterfsd_pid(mnode, volname):
bool : True if pid's matches. False otherwise.
"""
_rc = True
- bricks_list = get_all_bricks(mnode, volname)
+ bricks_list = glustolibs.gluster.brick_libs.get_all_bricks(mnode,
+ volname)
for brick in bricks_list:
brick_node, brick_path = brick.split(":")
ret = get_volume_status(mnode, volname)