]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Now auto-detects and prompts for a volume group using debconf.
authorThomas Goirand <thomas@goirand.fr>
Thu, 1 Nov 2012 16:41:11 +0000 (16:41 +0000)
committerThomas Goirand <thomas@goirand.fr>
Thu, 1 Nov 2012 16:53:42 +0000 (16:53 +0000)
debian/changelog
debian/cinder-common.config.in
debian/cinder-common.postinst.in
debian/cinder-common.postrm
debian/cinder-common.prerm
debian/cinder-common.templates
debian/po/templates.pot

index 9b9c0e68b2cc99bb1178ca3e6490bf68687cd26b..9efc2ad2f4ea760c95ab38c2efb1ebe69d601fc7 100644 (file)
@@ -19,6 +19,8 @@ cinder (2012.2-1) experimental; urgency=low
   * 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.
+  * Auto-detects a valide volume group name, and prompt the user with debconf
+  about it.
 
  -- Mehdi Abaakouk <sileht@sileht.net>  Sat, 29 Sep 2012 09:23:22 +0200
 
index 43c31f7d20c991fa5691d574471abdad64fd7ba0..03e46268432a2ceb501d8461e25eaff774900420 100644 (file)
@@ -26,7 +26,23 @@ 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
 
+pkgos_get_config ${CINDER_CONF} volume_group DEFAULT
+if [ -n "${RET}" ] ; then
+       db_set cinder/volume_group "${RET}"
+else
+       db_get cinder/volume_group
+       if [ -z "${RET}" ] && [ -x /sbin/vgdisplay ] ; then
+               # Since we have no prior value, try to guess it from vgdisplay
+               VGDISP=`vgdisplay -c | head -n 1`
+               if [ -n "${VGDISP}" ] ; then
+                       VGNAME=`echo ${VGDISP} | cut -d: -f1`
+                       db_set cinder/volume_group ${VGNAME}
+               fi
+       fi
+fi
+db_input high cinder/volume_group || true
+db_go
+
 exit 0
index 6dacd4a5c61d3a4e270b89d91285d0a100000226..4be0710fb3e2228caa6d315e8eb93e1f74c3e54e 100644 (file)
@@ -16,6 +16,12 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
        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
+       db_get cinder/volume_group
+       if [ -n "${RET}" ] ; then
+               pkgos_edit_config volume_group ${RET} ${CINDER_CONF} DEFAULT
+       fi
+
+       db_stop
 
        chmod 0440 /etc/sudoers.d/cinder-common
        echo "Now calling cinder-manage db sync: this may take a while..."
index aabb325edf4916421e89b3a0fc1cb5195c6d12cc..3dea78bd8837dbaed00abe70779b03758eb5f925 100644 (file)
@@ -6,7 +6,7 @@ if [ "$1" = "purge" ] && [ -f /usr/share/debconf/confmodule ] ; then
        if [ -f /usr/share/debconf/confmodule ] ; then
                . /usr/share/debconf/confmodule
 
-               db_get cinder/configure_db
+               db_get cinder/configure_db || true
                if [ "$RET" = "true" ]; then
                        if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
                                . /usr/share/dbconfig-common/dpkg/postrm
index 8e6f542b81823c35ecd5f64ee4ba660f754165ae..ecda68a06b14a0d42d44fc718fb74ccbace2c488 100644 (file)
@@ -4,7 +4,7 @@ set -e
 
 . /usr/share/debconf/confmodule
 
-db_get cinder/configure_db
+db_get cinder/configure_db || true
 if [ "$RET" = "true" ]; then
     . /usr/share/dbconfig-common/dpkg/prerm
     dbc_go cinder-common $@
index c98741f87740b841bea126a71875edea01bf99ad..1508e552e3d99b9352b36685692937c546beb14e 100644 (file)
@@ -44,3 +44,9 @@ _Description: Auth server username:
 Template: cinder/admin-password
 Type: password
 _Description: Auth server password:
+
+Template: cinder/volume_group
+Type: string
+_Description: Cinder volume group:
+ Please specify the name of the LVM volume group (vg) on which Cinder
+ will create partitions.
index be7069f31564df7790c0a01a843c75e5b1dcbc31..cdab8393d9b76eadcbbb693034169bd94eee365d 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: cinder\n"
 "Report-Msgid-Bugs-To: cinder@packages.debian.org\n"
-"POT-Creation-Date: 2012-09-17 09:47+0200\n"
+"POT-Creation-Date: 2012-11-01 16:43+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -70,3 +70,49 @@ msgid ""
 "You can change this setting later on by running \"dpkg-reconfigure -plow "
 "cinder-common\"."
 msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:3001
+msgid "Auth server hostname:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:3001
+msgid ""
+"Please specify the URL of your Cinder authentication server. Typically  this "
+"is also the URL of your OpenStack Identity Service (Keystone)."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:4001
+msgid "Auth server tenant name:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:5001
+msgid "Auth server username:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../cinder-common.templates:6001
+msgid "Auth server password:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:7001
+msgid "Cinder volume group:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../cinder-common.templates:7001
+msgid ""
+"Please specify the name of the LVM volume group (vg) on which Cinder will "
+"create partitions."
+msgstr ""