Always set the `cache_dir`

Following the pattern from other cookbooks to always set the
`cache_dir`.

Change-Id: I5e1e08311942c6847361f8e1555bac5615d9dc13
This commit is contained in:
John Dewey 2013-06-04 21:40:37 -07:00
parent 6f175ff7c0
commit 880e2195fb
3 changed files with 2 additions and 19 deletions

View File

@ -39,8 +39,6 @@ directory ::File.dirname(node["openstack"]["block-storage"]["api"]["auth"]["cach
owner node["openstack"]["block-storage"]["user"]
group node["openstack"]["block-storage"]["group"]
mode 00700
only_if { node["openstack"]["auth"]["strategy"] == "pki" }
end
service "cinder-api" do

View File

@ -26,9 +26,6 @@ describe "openstack-block-storage::api" do
expect(@chef_run).to upgrade_package "python-mysqldb"
end
##
#TODO: ChefSpec needs to handle guards better. This
# should only be created when pki is enabled.
describe "/var/cache/cinder" do
before do
@dir = @chef_run.directory "/var/cache/cinder"
@ -116,18 +113,8 @@ describe "openstack-block-storage::api" do
expect(sprintf("%o", @file.mode)).to eq "644"
end
it "has signing_dir with auth_strategy is pki" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
node = chef_run.node
node.set["openstack"]["auth"]["strategy"] = "pki"
chef_run.converge "openstack-block-storage::api"
expect(chef_run).to create_file_with_content @file.name,
"signing_dir = /var/cache/cinder/api"
end
it "does not have signing_dir when auth strategy is not pki" do
expect(@chef_run).not_to create_file_with_content @file.name,
it "has signing_dir" do
expect(@chef_run).to create_file_with_content @file.name,
"signing_dir = /var/cache/cinder/api"
end

View File

@ -58,6 +58,4 @@ auth_protocol = <%= @identity_admin_endpoint.scheme %>
admin_tenant_name = <%= node["openstack"]["block-storage"]["service_tenant_name"] %>
admin_user = <%= node["openstack"]["block-storage"]["service_user"] %>
admin_password = <%= @service_pass %>
<% if node["openstack"]["auth"]["strategy"] == "pki" -%>
signing_dir = <%= node["openstack"]["block-storage"]["api"]["auth"]["cache_dir"] %>
<% end -%>