From 73222e39cbc6f9fbba4ba8dd9d54d500078af4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Wed, 16 Oct 2013 17:26:30 +0200 Subject: [PATCH] use a log_file if syslog is disabled Change-Id: Ie4625c6a396267f9bb91f52f7431ff8b8727a045 --- Berksfile.lock | 4 ++-- CHANGELOG.md | 5 +++++ metadata.rb | 2 +- spec/cinder_common_spec.rb | 17 ++++++++++++++++- templates/default/cinder.conf.erb | 2 ++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Berksfile.lock b/Berksfile.lock index a77c01b..b747856 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -2,8 +2,8 @@ "sha": "ba71763fac936d414bd4a63f004357f86f6e1bfb", "sources": { "openstack-block-storage": { - "locked_version": "7.0.3", - "constraint": "= 7.0.3", + "locked_version": "7.0.4", + "constraint": "= 7.0.4", "path": "." }, "openstack-image": { diff --git a/CHANGELOG.md b/CHANGELOG.md index a587ace..e621ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ openstack-block-storage Cookbook CHANGELOG ============================== This file is used to list changes made in each version of the openstack-block-storage cookbook. +v7.0.4 +------ +### Improvement +- Use a default log-file (/var/log/cinder/cinder.log) if syslog is disabled + v7.0.3 ------ ### Bug diff --git a/metadata.rb b/metadata.rb index ed54eb1..1f3349e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com" license "Apache 2.0" description "The OpenStack Advanced Volume Management service Cinder." long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "7.0.3" +version "7.0.4" recipe "openstack-block-storage::common", "Defines the common pieces of repeated code from the other recipes" recipe "openstack-block-storage::api", "Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone" diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 6e88b4f..c464dc3 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -7,7 +7,7 @@ describe "openstack-block-storage::cinder-common" do n.set["openstack"]["mq"] = { "host" => "127.0.0.1" } - n.set["openstack"]["block-storage"]["syslog"]["use"] = true + end @chef_run.converge "openstack-block-storage::cinder-common" end @@ -58,6 +58,21 @@ describe "openstack-block-storage::cinder-common" do "rabbit_ha_queues=" end + it "has log_file" do + expect(@chef_run).to create_file_with_content @file.name, + "log_file = /var/log/cinder/cinder.log" + end + + it "has log_config when syslog is true" do + chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| + n.set["openstack"]["block-storage"]["syslog"]["use"] = true + end + chef_run.converge "openstack-block-storage::cinder-common" + + expect(chef_run).to create_file_with_content @file.name, + "log_config = /etc/openstack/logging.conf" + end + it "has rabbit_port" do expect(@chef_run).to create_file_with_content @file.name, "rabbit_port=5672" diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index fb6fecf..e270e71 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -41,6 +41,8 @@ notification_driver=cinder.openstack.common.notifier.rpc_notifier <% if node["openstack"]["block-storage"]["syslog"]["use"] %> log_config = /etc/openstack/logging.conf +<% else %> +log_file = /var/log/cinder/cinder.log <% end %> ######## defined in cinder.flags ########