summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/brick_libs.py
diff options
context:
space:
mode:
authorAkarsha <akrai@redhat.com>2018-04-12 11:31:47 +0530
committerAkarsha <akrai@redhat.com>2018-04-18 13:11:33 +0530
commit01bdb218a797d5035537e936dc3b7e345c6f7dae (patch)
treeb026e4890e2b8193277307d03319e15854c588a7 /glustolibs-gluster/glustolibs/gluster/brick_libs.py
parent8c8ad217e48da60ec5d05e8fc50b93a3fc17a0ea (diff)
Library to bring bricks specified in the brick_list online when brick mux is enabled
Change-Id: I0ae0d45050501154e9cd69c0d3dc9e915ae21b3a Signed-off-by: Akarsha <akrai@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brick_libs.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brick_libs.py b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
index a677892..f3e18ec 100644
--- a/glustolibs-gluster/glustolibs/gluster/brick_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
@@ -293,7 +293,19 @@ def bring_bricks_online(mnode, volname, bricks_list,
failed_to_bring_online_list = []
for brick in bricks_list:
bring_brick_online_method = random.choice(bring_bricks_online_methods)
- if bring_brick_online_method == 'glusterd_restart':
+ if is_brick_mux_enabled(mnode):
+ bring_bricks_online_command = ("gluster volume start %s force" %
+ volname)
+ ret, _, _ = g.run(mnode, bring_bricks_online_command)
+ if ret != 0:
+ g.log.error("Unable to start the volume %s with force option",
+ volname)
+ _rc = False
+ else:
+ g.log.info("Successfully restarted volume %s to bring all "
+ "the bricks '%s' online", volname, bricks_list)
+
+ elif bring_brick_online_method == 'glusterd_restart':
bring_brick_online_command = "service glusterd restart"
brick_node, _ = brick.split(":")
ret, _, _ = g.run(brick_node, bring_brick_online_command)
@@ -305,6 +317,7 @@ def bring_bricks_online(mnode, volname, bricks_list,
else:
g.log.info("Successfully restarted glusterd on node %s to "
"bring back brick %s online", brick_node, brick)
+
elif bring_brick_online_method == 'volume_start_force':
bring_brick_online_command = ("gluster volume start %s force" %
volname)