Adding guard around deleting sqlite db

* Don't delete if node.openstack.db.identity.db_type is set to sqlite

Fixes: bug #1251044

Change-Id: I8912808f2858e75c26bab39a0e61662bc63dd495
This commit is contained in:
galstrom21
2013-11-13 16:17:33 -06:00
parent 9b06b4b8ec
commit 4b204984ad
4 changed files with 16 additions and 1 deletions

View File

@@ -2,6 +2,11 @@
This file is used to list changes made in each version of cookbook-openstack-identity.
## 7.0.2:
### Bug
* Do not delete the sqlite database when node.openstack.db.identity.db_type is set to sqlite.
* Added `does not delete keystone.db when configured to use sqlite` test case for this scenario
## 7.0.1:
* Fixed <db_type>_python_packages issue when setting node.openstack.db.identity.db_type to sqlite.
* Added `converges when configured to use sqlite db backend` test case for this scenario.

View File

@@ -4,7 +4,7 @@ maintainer_email "matt@opscode.com"
license "Apache 2.0"
description "The OpenStack Identity service Keystone."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "7.0.1"
version "7.0.2"
recipe "openstack-identity::server", "Installs and Configures Keystone Service"
recipe "openstack-identity::registration", "Adds user, tenant, role and endpoint records to Keystone"

View File

@@ -85,6 +85,7 @@ end
file "/var/lib/keystone/keystone.db" do
action :delete
not_if { node["openstack"]["db"]["identity"]["db_type"] == "sqlite" }
end
execute "keystone-manage pki_setup" do

View File

@@ -123,6 +123,15 @@ describe "openstack-identity::server" do
expect(@chef_run).to delete_file "/var/lib/keystone/keystone.db"
end
it "does not delete keystone.db when configured to use sqlite" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts
node = chef_run.node
node.set["openstack"]["db"]["identity"]["db_type"] = "sqlite"
chef_run.converge "openstack-identity::server"
expect(chef_run).not_to delete_file "/var/lib/keystone/keystone.db"
end
describe "pki setup" do
before { @cmd = "keystone-manage pki_setup" }