summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/brick_libs.py
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2018-04-25 17:22:41 +0530
committerNigel Babu <nigelb@redhat.com>2018-04-25 17:22:41 +0530
commitcb9f6652962bf88f1061d981736e7e02e5608a23 (patch)
tree99a948a721122c9df80f48d9e2ec4a2f24b3cffa /glustolibs-gluster/glustolibs/gluster/brick_libs.py
parentdc906e7451a920248e5a85fa4cf051758bc3fc6f (diff)
Fix cyclic import in brickmux_ops.py
Change-Id: I487822efd6c57b8c51b65b4eaf149eb67e96731b
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brick_libs.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py22
1 files changed, 8 insertions, 14 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: