From dc1e00ce7097f8a7c6b590ae4af7c59b025716ce Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Fri, 26 Oct 2012 15:31:24 +0000 Subject: [PATCH] * Now asking for Keystone credentials using the new pkg_os function. * Patches api-paste.ini for syntax. Rewritten-From: 067671210ae82140f63a390a3808be58ef8313d6 --- xenial/debian/changelog | 2 ++ xenial/debian/cinder-common.config.in | 3 +++ xenial/debian/cinder-common.install | 12 +++++------ xenial/debian/cinder-common.postinst.in | 4 ++++ xenial/debian/cinder-common.postrm | 2 +- xenial/debian/cinder-common.templates | 21 +++++++++++++++++++ .../patches/fix-api-paste.ini-syntax.patch | 17 +++++++++++++++ xenial/debian/patches/series | 1 + 8 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 xenial/debian/patches/fix-api-paste.ini-syntax.patch diff --git a/xenial/debian/changelog b/xenial/debian/changelog index 4c863ad01..9b9c0e68b 100644 --- a/xenial/debian/changelog +++ b/xenial/debian/changelog @@ -17,6 +17,8 @@ cinder (2012.2-1) experimental; urgency=low * Removed useless empty cinder-volume.postrm, cinder-api.postrm, cinder-scheduler.postinst, cinder-scheduler.postrm. * Pre-Depends: dpkg (>= 1.15.6~) because we use xz compression. + * Asks for admin tenant, user and password with debconf, patches + api-paste.ini so it is syntaxicaly correct. -- Mehdi Abaakouk Sat, 29 Sep 2012 09:23:22 +0200 diff --git a/xenial/debian/cinder-common.config.in b/xenial/debian/cinder-common.config.in index f8b7570e6..43c31f7d2 100644 --- a/xenial/debian/cinder-common.config.in +++ b/xenial/debian/cinder-common.config.in @@ -5,6 +5,7 @@ set -e . /usr/share/debconf/confmodule CINDER_COM_DEF=/etc/default/cinder-common CINDER_CONF=/etc/cinder/cinder.conf +CINDER_API=/etc/cinder/api-paste.ini #PKGOS-INCLUDE# @@ -25,5 +26,7 @@ CINDER_ENABLE=${CINDER_ENABLE}" >${CINDER_COM_DEF} pkgos_var_user_group cinder manage_cinder_enable pkgos_dbc_read_conf ${CINDER_CONF} cinder DEFAULT sql_connection $@ +set -x +pkgos_read_admin_creds ${CINDER_API} cinder filter:authtoken exit 0 diff --git a/xenial/debian/cinder-common.install b/xenial/debian/cinder-common.install index 484de9fb7..c0e2f1028 100644 --- a/xenial/debian/cinder-common.install +++ b/xenial/debian/cinder-common.install @@ -1,8 +1,8 @@ usr/bin/cinder-manage usr/bin/cinder-rootwrap -etc/cinder/policy.json etc/cinder -etc/cinder/api-paste.ini etc/cinder -etc/cinder/rootwrap.d/volume.filters /etc/cinder/rootwrap.d -etc/cinder/rootwrap.conf etc/cinder -debian/cinder.conf usr/share/cinder-common -debian/logging.conf etc/cinder +etc/cinder/policy.json /etc/cinder +debian/logging.conf /etc/cinder +etc/cinder/rootwrap.conf /etc/cinder +etc/cinder/rootwrap.d/volume.filters /etc/cinder/rootwrap.d +debian/cinder.conf /usr/share/cinder-common +etc/cinder/api-paste.ini /usr/share/cinder-common diff --git a/xenial/debian/cinder-common.postinst.in b/xenial/debian/cinder-common.postinst.in index df75c7391..2cb112c3d 100644 --- a/xenial/debian/cinder-common.postinst.in +++ b/xenial/debian/cinder-common.postinst.in @@ -1,8 +1,10 @@ #!/bin/sh set -e +set -x CINDER_CONF=/etc/cinder/cinder.conf +CINDER_API=/etc/cinder/api-paste.ini #PKGOS-INCLUDE# @@ -12,7 +14,9 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then pkgos_var_user_group cinder pkgos_write_new_conf cinder cinder.conf + pkgos_write_new_conf cinder api-paste.ini pkgos_dbc_postinst ${CINDER_CONF} cinder DEFAULT sql_connection $@ + pkgos_write_admin_creds ${CINDER_API} cinder filter:authtoken chmod 0440 /etc/sudoers.d/cinder-common echo "Now calling cinder-manage db sync: this may take a while..." diff --git a/xenial/debian/cinder-common.postrm b/xenial/debian/cinder-common.postrm index 365f34c3e..aabb325ed 100644 --- a/xenial/debian/cinder-common.postrm +++ b/xenial/debian/cinder-common.postrm @@ -21,7 +21,7 @@ if [ "$1" = "purge" ] && [ -f /usr/share/debconf/confmodule ] ; then fi fi - rm -f /etc/cinder/cinder.conf + rm -f /etc/cinder/cinder.conf /etc/cinder/api-paste.ini rmdir --ignore-fail-on-non-empty /etc/cinder rm -f /etc/default/cinder-common rm -rf /var/lib/cinder /var/log/cinder diff --git a/xenial/debian/cinder-common.templates b/xenial/debian/cinder-common.templates index 367e7c105..c98741f87 100644 --- a/xenial/debian/cinder-common.templates +++ b/xenial/debian/cinder-common.templates @@ -23,3 +23,24 @@ _Description: Set up a database for Cinder? . You can change this setting later on by running "dpkg-reconfigure -plow cinder-common". + +Template: cinder/auth-host +Type: string +Default: 127.0.0.1 +_Description: Auth server hostname: + Please specify the URL of your Cinder authentication server. Typically + this is also the URL of your OpenStack Identity Service (Keystone). + +Template: cinder/admin-tenant-name +Type: string +Default: admin +_Description: Auth server tenant name: + +Template: cinder/admin-user +Type: string +Default: admin +_Description: Auth server username: + +Template: cinder/admin-password +Type: password +_Description: Auth server password: diff --git a/xenial/debian/patches/fix-api-paste.ini-syntax.patch b/xenial/debian/patches/fix-api-paste.ini-syntax.patch new file mode 100644 index 000000000..a7ec4282f --- /dev/null +++ b/xenial/debian/patches/fix-api-paste.ini-syntax.patch @@ -0,0 +1,17 @@ +Description: Fixes api-paste.ini syntax so it is really a .ini file +Author: Thomas Goirand +Forwarded: no + +--- cinder-2012.2.orig/etc/cinder/api-paste.ini ++++ cinder-2012.2/etc/cinder/api-paste.ini +@@ -4,8 +4,8 @@ + + [composite:osapi_volume] + use = call:cinder.api.openstack.urlmap:urlmap_factory +-/: osvolumeversions +-/v1: openstack_volume_api_v1 ++/ = osvolumeversions ++/v1 = openstack_volume_api_v1 + + [composite:openstack_volume_api_v1] + use = call:cinder.api.auth:pipeline_factory diff --git a/xenial/debian/patches/series b/xenial/debian/patches/series index 25c0f244e..a144c7af4 100644 --- a/xenial/debian/patches/series +++ b/xenial/debian/patches/series @@ -1 +1,2 @@ install-missing-files.patch +fix-api-paste.ini-syntax.patch -- 2.45.2