From e5a28bc5baebbfdc802aa3be9800c55a612ee460 Mon Sep 17 00:00:00 2001
From: Thomas Goirand <thomas@goirand.fr>
Date: Thu, 1 Oct 2015 20:00:48 +0000
Subject: [PATCH] Fixed the default path for lock_path.

Rewritten-From: 711d62503c92f362a08ea65872226dd4e855e7ff
---
 trusty/debian/changelog | 1 +
 trusty/debian/rules     | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/trusty/debian/changelog b/trusty/debian/changelog
index 3f0d75042..9eb87ff5e 100644
--- a/trusty/debian/changelog
+++ b/trusty/debian/changelog
@@ -3,6 +3,7 @@ cinder (2:7.0.0~rc1-2) experimental; urgency=medium
   * cinder-api depends on python-openstackclient.
   * Fixed cinder.conf generation.
   * cinder-api also registering the volumev2 type.
+  * Fixed the default path for lock_path.
 
  -- Thomas Goirand <zigo@debian.org>  Tue, 29 Sep 2015 13:23:42 +0000
 
diff --git a/trusty/debian/rules b/trusty/debian/rules
index 5126faffd..883f3d393 100755
--- a/trusty/debian/rules
+++ b/trusty/debian/rules
@@ -59,14 +59,17 @@ override_dh_install:
 	./debian/gen-fixed-config
 	#cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
 
+	# Set a default value for lock_path
+	sed -i 's|^[ \t#]*lock_path[ \t]*=.*|lock_path = /var/lock/cinder|' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+
 	# Disable https in default setup, as this makes our CI fail
-	sed -i 's/^[ \t#]*auth_protocol[ \t]*=[ \t].*/auth_protocol = http/' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+	sed -i 's/^[ \t#]*auth_protocol[ \t]*=.*/auth_protocol = http/' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
 
 	# Default to keystone auth
 	sed -i "s/#auth_strategy=noauth/auth_strategy=keystone/" $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
 
 	# Write only in /var/lib/cinder please
-	sed -i 's|#state_path=$pybasedir|state_path=/var/lib/cinder|' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+	sed -i 's|#[ \t#]*state_path[ \t]*=.*|state_path=/var/lib/cinder|' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
 
 	# Fix the missing sql_connection directive
 	#echo "# Connection to db:" >>$(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
-- 
2.45.2