From dcb23a55503434912cc5d64c79c032695150f0fc Mon Sep 17 00:00:00 2001
From: Xinyu Zhao <zhaoxinyu@huawei.com>
Date: Tue, 22 Apr 2014 18:20:04 +0000
Subject: [PATCH] Make sure cinder volume db sync successfully

Before running rsyslog restart make sure openstack services
start normally, otherwise, rsyslog restart will fail without
monitored dirs created by openstack services.

Change-Id: Icb3f91e97d8403130afa390fd4508a954cb41240
---
 chef/cookbooks/openstack-block-storage/recipes/volume.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chef/cookbooks/openstack-block-storage/recipes/volume.rb b/chef/cookbooks/openstack-block-storage/recipes/volume.rb
index 487a5d2..1191649 100644
--- a/chef/cookbooks/openstack-block-storage/recipes/volume.rb
+++ b/chef/cookbooks/openstack-block-storage/recipes/volume.rb
@@ -61,7 +61,7 @@ directory "/var/lock/cinder" do
   mode 00700
 end
 
-execute "cinder-manage db sync"
+execute "timeout 300s sh -c 'while ! cinder-manage db sync; do sleep 30; done'"
 
 case node["openstack"]["block-storage"]["volume"]["driver"]
   when "cinder.volume.drivers.netapp.iscsi.NetAppISCSIDriver"