diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ec59f7..7be06d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This file is used to list changes made in each version of cookbook-openstack-image. +## 7.0.6 +### Bug +* Do not delete the sqlite database layed down by the glance packages when node.openstack.db.image.db_type is set to sqlite. + ## 7.0.5: * Allow swift packages to be optionally installed. diff --git a/metadata.rb b/metadata.rb index e57f8e8..250f596 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer "Opscode, Inc." license "Apache 2.0" description "Installs and configures the Glance Image Registry and Delivery Service" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "7.0.5" +version "7.0.6" recipe "openstack-image::api", "Installs packages required for a glance api server" recipe "openstack-image::registry", "Installs packages required for a glance registry server" recipe "openstack-image::identity_registration", "Registers Glance endpoints and service with Keystone" diff --git a/recipes/registry.rb b/recipes/registry.rb index 45142cf..89e8620 100644 --- a/recipes/registry.rb +++ b/recipes/registry.rb @@ -83,6 +83,7 @@ end file "/var/lib/glance/glance.sqlite" do action :delete + not_if { node["openstack"]["db"]["image"]["db_type"] == "sqlite" } end directory "/etc/glance" do diff --git a/spec/registry_spec.rb b/spec/registry_spec.rb index ee5d505..c04393c 100644 --- a/spec/registry_spec.rb +++ b/spec/registry_spec.rb @@ -68,6 +68,16 @@ describe "openstack-image::registry" do expect(@chef_run).to delete_file "/var/lib/glance/glance.sqlite" end + it "does not delete glance.sqlite 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"]["image"]["db_type"] = "sqlite" + chef_run.stub_command("glance-manage db_version", true) + chef_run.converge "openstack-image::registry" + expect(chef_run).not_to delete_file "/var/lib/glance/glance.sqlite" + end + expect_creates_glance_dir describe "glance-registry.conf" do