From 53efbf52250e63c9022163d5ba048ce014cc0d97 Mon Sep 17 00:00:00 2001 From: "Luis A. Garcia" Date: Sat, 14 Dec 2013 01:30:54 +0000 Subject: [PATCH] Create lock directory for cinder This patch creates the /var/lock/cinder directory (or other location specified in the corresponding attribute) to use for lock files. Change-Id: I23d2d8a201f892cc1bf56f8db825f70fc1fdf5d6 --- recipes/cinder-common.rb | 7 +++++++ spec/cinder_common_spec.rb | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/recipes/cinder-common.rb b/recipes/cinder-common.rb index 766f847..304d7d3 100644 --- a/recipes/cinder-common.rb +++ b/recipes/cinder-common.rb @@ -63,3 +63,10 @@ template "/etc/cinder/cinder.conf" do :glance_port => glance_api_endpoint.port ) end + +directory node["openstack"]["block-storage"]["lock_path"] do + group node["openstack"]["block-storage"]["group"] + owner node["openstack"]["block-storage"]["user"] + mode 00700 +end + diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 157c04a..6510c9f 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -214,4 +214,20 @@ describe "openstack-block-storage::cinder-common" do end end end + + describe "/var/lock/cinder" do + before do + @dir = @chef_run.directory "/var/lock/cinder" + end + + it "has proper owner" do + expect(@dir.owner).to eq("cinder") + expect(@dir.group).to eq("cinder") + end + + it "has proper modes" do + expect(sprintf("%o", @dir.mode)).to eq "700" + end + end + end