summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/brick_libs.py
diff options
context:
space:
mode:
authorShwethaHP <spandura@redhat.com>2017-08-23 17:24:57 +0530
committerShwethaHP <spandura@redhat.com>2017-08-28 10:15:34 +0530
commitdfe392e04ee3a126fad2a9b3b5c526f7f7594cf5 (patch)
tree9eeb1751c01b4cb45e6624a613625273d52ec5af /glustolibs-gluster/glustolibs/gluster/brick_libs.py
parenta8701fc8c8855429e9fc7da99dbe2b6b952802f2 (diff)
1) bring_bricks_online: Wait for bricks to be online for 30 seconds
after bringing them online. 2) log all the xml output/error to DEBUG log level. Change-Id: If6bb758ac728f299292def9d72c0ef166a1569ae Signed-off-by: ShwethaHP <spandura@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brick_libs.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brick_libs.py b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
index b4d2328..6c32fe5 100644
--- a/glustolibs-gluster/glustolibs/gluster/brick_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
@@ -18,6 +18,7 @@
import random
from math import ceil
+import time
from glusto.core import Glusto as g
from glustolibs.gluster.volume_ops import (get_volume_info, get_volume_status)
from glustolibs.gluster.volume_libs import (get_subvols, is_tiered_volume,
@@ -245,6 +246,9 @@ def bring_bricks_online(mnode, volname, bricks_list,
elif isinstance(bring_bricks_online_methods, str):
bring_bricks_online_methods = [bring_bricks_online_methods]
+ g.log.info("Bringing bricks '%s' online with '%s'",
+ bricks_list, bring_bricks_online_methods)
+
_rc = True
failed_to_bring_online_list = []
for brick in bricks_list:
@@ -258,6 +262,9 @@ def bring_bricks_online(mnode, volname, bricks_list,
brick_node)
_rc = False
failed_to_bring_online_list.append(brick)
+ 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)
@@ -267,18 +274,17 @@ def bring_bricks_online(mnode, volname, bricks_list,
volname)
_rc = False
else:
+ g.log.info("Successfully restarted volume %s to bring all "
+ "the bricks '%s' online", volname, bricks_list)
break
else:
g.log.error("Invalid method '%s' to bring brick online",
bring_brick_online_method)
return False
- if not _rc:
- g.log.error("Unable to bring some of the bricks %s online",
- failed_to_bring_online_list)
- return False
- g.log.info("All the bricks : %s are brought online", bricks_list)
- return True
+ g.log.info("Waiting for 30 seconds for all the bricks to be online")
+ time.sleep(30)
+ return _rc
def are_bricks_offline(mnode, volname, bricks_list):