From 0a87ebcf6262370181456d33f5aecff9644f8401 Mon Sep 17 00:00:00 2001
From: Thomas Goirand <thomas@goirand.fr>
Date: Fri, 31 May 2013 17:17:09 +0800
Subject: [PATCH] * Added creation and chown of /var/lib/cinder/{cache,volumes}
 after the   removal of the -R flag when doing the chown in
 openstack-pkg-tools.

Rewritten-From: 170f4e8180edb3a002175c679c6bff0512719e9b
---
 trusty/debian/changelog                 | 2 ++
 trusty/debian/cinder-common.postinst.in | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/trusty/debian/changelog b/trusty/debian/changelog
index 25e3e67b6..1bd7d5f70 100644
--- a/trusty/debian/changelog
+++ b/trusty/debian/changelog
@@ -2,6 +2,8 @@ cinder (2013.1.1-2) unstable; urgency=low
 
   * Added if [ -r /usr/share/dbconfig-common/dpkg/prerm ] in the prerm.
   * Ran wrap-and-sort to clean stuff.
+  * Added creation and chown of /var/lib/cinder/{cache,volumes} after the
+    removal of the -R flag when doing the chown in openstack-pkg-tools.
 
  -- Thomas Goirand <zigo@debian.org>  Thu, 23 May 2013 00:08:47 +0800
 
diff --git a/trusty/debian/cinder-common.postinst.in b/trusty/debian/cinder-common.postinst.in
index 2c6ffff4b..61ae7e12d 100644
--- a/trusty/debian/cinder-common.postinst.in
+++ b/trusty/debian/cinder-common.postinst.in
@@ -12,6 +12,13 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
 	. /usr/share/dbconfig-common/dpkg/postinst
 
 	pkgos_var_user_group cinder
+
+	# we need few folders with cinder:cinder rights.
+	mkdir -p /var/lib/cinder/cache
+	mkdir -p /var/lib/cinder/volumes
+	chown cinder:cinder /var/lib/cinder/cache
+	chown cinder:cinder /var/lib/cinder/volumes
+
 	pkgos_write_new_conf cinder cinder.conf
 	pkgos_write_new_conf cinder api-paste.ini
 	pkgos_dbc_postinst ${CINDER_CONF} DEFAULT sql_connection cinder $@
-- 
2.45.2