Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85b379c

Browse files
committed
Merge pull request alphagov#111 from alphagov/sleep_after_reboot
RabbitMQ: Sleep for 10 seconds before next reboot
2 parents 40b5820 + 71604a6 commit 85b379c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rabbitmq.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ def cluster_is_ok():
2828
# We need to ensure that partitions is empty, and the list of running nodes
2929
# is the same as the list of known nodes.
3030

31-
status = re.sub(r'\s', '', status)
31+
status = re.sub(r'\s', '', status)
3232
known_nodes = re.search(r'\{nodes,\[\{disc,\[([^]]+)\]', status)
3333
running_nodes = re.search(r'\{running_nodes,\[([^]]+)\]', status)
3434
partitions = re.search(r'\{partitions,\[([^]]*)\]', status)
3535

3636
if not known_nodes or not running_nodes or not partitions:
37-
print("Couldn't parse status output: %r" % status)
37+
print("No matches found in output: %r" % status)
3838
return False
3939

4040
known_nodes = ','.join(sorted(known_nodes.group(1).split(',')))
@@ -65,3 +65,4 @@ def safe_reboot():
6565
sleep(5)
6666

6767
execute(vm.reboot, hosts=[env['host_string']])
68+
sleep(10)

0 commit comments

Comments
 (0)