cinder 8.0.0-1 updated for Mitaka 9.0 41/16241/13
authorArtem Silenkov <asilenkov@mirantis.com>
Tue, 19 Jan 2016 12:13:51 +0000 (15:13 +0300)
committerArtem Silenkov <asilenkov@mirantis.com>
Thu, 21 Jan 2016 13:33:06 +0000 (16:33 +0300)
  * Version synced from anonscm.debian.org/debian/mitaka/for-trusty
  * Requirements updated to global Mitaka

Change-Id: I282304ffd28f08684a420f49d14a6aa3d99343b5

trusty/debian/changelog
trusty/debian/cinder-api.postinst.in
trusty/debian/cinder-common.install
trusty/debian/control
trusty/debian/gbp.conf
trusty/debian/gen-fixed-config [new file with mode: 0755]
trusty/debian/patches/Missing_configuration_opts_from_cinder.sample.conf.patch [new file with mode: 0644]
trusty/debian/pydist-overrides
trusty/debian/rules

index e9d5601397b1a79af64621c63f6f92eba0d46c58..868fe37df940502ec59b9040813ffc9da0bde8bb 100644 (file)
@@ -1,11 +1,63 @@
-cinder (2:7.0.0~b2-1~u14.04+mos1) mos8.0; urgency=medium
+cinder (2:8.0.0-1~u14.04+mos1) mos9.0; urgency=medium
 
-  * Source: http://http.debian.net/debian/pool/main/c/cinder/cinder_7.0.0~b3-1.dsc
-  * Package version is lowered to satisfy the code version in 8.0 branch.
-  * Remove disable-zfs-tests.patch , code was changed.
-  * Add suds-jurko to pydist-overrides file.
+  * Version synced from anonscm.debian.org/debian/mitaka/for-trusty
+  * Requirements updated to global Mitaka
 
- -- Ivan Udovichenko <iudovichenko@mirantis.com>  Thu, 24 Sep 2015 23:55:34 +0300
+ -- Artem Silenkov <asilenkov@mirantis.com>  Tue, 19 Jan 2016 14:58:39 +0300
+
+cinder (2:8.0.0~b1-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Fixed (build-)depends for this release.
+  * Removed disable-zfs-tests.patch.
+  * Removed Downstream_Fix_for_Genconfig.patch.
+
+ -- Thomas Goirand <zigo@debian.org>  Mon, 07 Dec 2015 14:05:41 +0100
+
+cinder (2:7.0.0-4) unstable; urgency=medium
+
+  * Added q-text-as-data as depends for cinder-api.
+
+ -- Thomas Goirand <zigo@debian.org>  Tue, 03 Nov 2015 11:32:01 +0000
+
+cinder (2:7.0.0-3) unstable; urgency=medium
+
+  * Using Keystone API v3 to register in the catalog.
+
+ -- Thomas Goirand <zigo@debian.org>  Mon, 02 Nov 2015 18:19:42 +0000
+
+cinder (2:7.0.0-2) unstable; urgency=medium
+
+  * Uploading to unstable.
+
+ -- Thomas Goirand <zigo@debian.org>  Fri, 16 Oct 2015 13:44:00 +0000
+
+cinder (2:7.0.0-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Setup both v1 and v2 endpoints.
+
+ -- Thomas Goirand <zigo@debian.org>  Thu, 15 Oct 2015 15:49:18 +0200
+
+cinder (2:7.0.0~rc2-1) experimental; urgency=medium
+
+  * cinder-api depends on python-openstackclient.
+  * cinder-api also registering the volumev2 type.
+  * Fixed cinder.conf generation:
+    - Fixed the default path for lock_path.
+    - Added upstream patch for fixing config file generation.
+    - Manually set enabled_backends = lvm, and appends a [lvm] section to set
+      the LVM backend as default.
+
+ -- Thomas Goirand <zigo@debian.org>  Tue, 29 Sep 2015 13:23:42 +0000
+
+cinder (2:7.0.0~rc1-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Fixed (build-)depends for this release.
+  * Refresh patch.
+
+ -- Thomas Goirand <zigo@debian.org>  Fri, 25 Sep 2015 10:01:08 +0200
 
 cinder (2:7.0.0~b3-1) experimental; urgency=medium
 
index ff22918c622f8fec827250391e55e1bac53b65bd..7cea903d6542b4325e606820bc211ddb630de427 100644 (file)
@@ -6,7 +6,73 @@ set -e
 
 if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
        . /usr/share/debconf/confmodule
-       pkgos_register_endpoint_postinst cinder cinder volume "Cinder Volume Service" 8776 /v1/'%(tenant_id)s'
+
+       # We need special handling for Cinder, as it needs 2 endpoints
+       PKG_NAME=cinder
+       db_get ${PKG_NAME}/register-endpoint
+       if [ "${RET}" = "true" ] ; then
+               # Setup the v1 endpoint
+               db_get ${PKG_NAME}/keystone-ip
+               KEYSTONE_ENDPOINT_IP=`echo ${RET} | egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'`
+               db_get ${PKG_NAME}/keystone-auth-token
+               AUTH_TOKEN=${RET}
+               db_get ${PKG_NAME}/endpoint-ip
+               PKG_ENDPOINT_IP=`echo ${RET} | egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'`
+               db_get ${PKG_NAME}/region-name
+               REGION_NAME=${RET}
+
+               if [ -n "${KEYSTONE_ENDPOINT_IP}" ] && [ -n "${PKG_ENDPOINT_IP}" ] && [ -n "${REGION_NAME}" ] && [ -n "${AUTH_TOKEN}" ] ; then
+                       SERVICE_NAME=cinder
+                       SERVICE_TYPE=volume
+                       SERVICE_DESC="OpenStack Block Storage"
+                       SERVICE_PORT=8776
+                       SERVICE_URL=/v1/'%(tenant_id)s'
+                       echo "Registering service and endpoints for ${SERVICE_NAME} with type ${SERVICE_TYPE} at http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}"
+                       NUM_LINES=$(openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l)
+                       if [ "${NUM_LINES}" = "0" ] ; then
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service create \
+                                       --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+                       fi
+
+                       SERVICE_NAME=cinderv2
+                       SERVICE_TYPE=volumev2
+                       SERVICE_DESC="OpenStack Block Storage v2"
+                       SERVICE_PORT=8776
+                       SERVICE_URL=/v2/'%(tenant_id)s'
+                       echo "Registering service and endpoints for ${SERVICE_NAME} with type ${SERVICE_TYPE} at http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}"
+                       NUM_LINES=$(openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l)
+                       if [ "${NUM_LINES}" = "0" ] ; then
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service create \
+                                       --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+
+                               openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \
+                                       --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}
+                       fi
+#                      pkgos_register_endpoint_postinst cinder cinder volume "Cinder Volume Service" 8776 /v1/'%(tenant_id)s'
+#                      pkgos_register_endpoint_postinst cinder cinderv2 volumev2 "Cinder Volume Service" 8776 /v2/'%(tenant_id)s'
+               else
+                       echo "Problem in endpoint parameter (IPs or otherwise)."
+               fi
+               db_unregister ${PKG_NAME}/register-endpoint
+       else
+               echo "Will not register "${SERVICE_NAME}" endpoint this time (no user request for it)."
+       fi
+       db_unregister ${PKG_NAME}/keystone-auth-token
        db_stop
 fi
 
index 31637068a0958b0d12745064cf50a49ce9fa8292..3fb3a28e55c0d65a64f1324c834471ef5228ecf8 100644 (file)
@@ -4,3 +4,4 @@ etc/cinder/rootwrap.conf                /etc/cinder
 usr/bin/cinder-manage
 usr/bin/cinder-rootwrap
 usr/bin/cinder-rtstool
+usr/bin/cinder-wsgi
index c25acfd8036d23767c91ec8ec3a61775f4cc9058..027dd3944879c44e74c289db5cff8380e0dca5ea 100644 (file)
@@ -4,54 +4,54 @@ Priority: extra
 Maintainer: PKG OpenStack <openstack-devel@lists.alioth.debian.org>
 Uploaders: Thomas Goirand <zigo@debian.org>,
 Build-Depends: debhelper (>= 9),
+               git,
                dh-python,
                dh-systemd,
                openstack-pkg-tools (>= 23~),
                po-debconf,
                python-all,
-               python-pbr (>= 1.6),
+               python-pbr (>= 1.8),
                python-setuptools,
                python-sphinx,
 Build-Depends-Indep: bandit (>= 0.13.2),
                      python-anyjson,
                      python-babel,
-                     python-barbicanclient (>= 3.0.1),
+                     python-barbicanclient (>= 3.3.0),
                      python-coverage,
                      python-crypto,
-                     python-ddt (>= 0.7.0),
+                     python-ddt (>= 1.0.1),
                      python-enum34,
                      python-eventlet (>= 0.17.4),
                      python-fixtures (>= 1.3.1),
-                     python-glanceclient (>= 1:0.18.0),
+                     python-glanceclient (>= 1:1.2.0),
                      python-greenlet,
-                     python-hacking (>= 0.10.0),
+                     python-hacking (>= 0.10.2),
                      python-iso8601,
-                     python-keystonemiddleware (>= 2.0.0),
-                     python-kombu,
+                     python-keystonemiddleware (>= 4.0.0),
                      python-lxml,
                      python-migrate (>= 0.9.6),
                      python-mock (>= 1.3),
                      python-mox3,
                      python-mysqldb,
-                     python-netaddr (>= 0.7.12),
-                     python-novaclient (>= 2:2.26.0),
-                     python-os-brick (>= 0.3.2),
-                     python-os-testr,
+                     python-novaclient (>= 2:2.29.0),
+                     python-os-brick (>= 0.4.0),
+                     python-os-testr (>= 0.4.2),
+                     python-os-win,
                      python-oslo.concurrency (>= 2.3.0),
-                     python-oslo.config (>= 1:2.1.0),
+                     python-oslo.config (>= 1:3.2.0),
                      python-oslo.context (>= 0.2.0),
-                     python-oslo.db (>= 2.4.1),
+                     python-oslo.db (>= 4.1.0),
                      python-oslo.i18n (>= 1.5.0),
-                     python-oslo.log (>= 1.8.0),
-                     python-oslo.messaging (>= 1.16.0),
-                     python-oslo.middleware (>= 2.4.0),
+                     python-oslo.log (>= 2.0.0),
+                     python-oslo.messaging (>= 3.0.0),
+                     python-oslo.middleware (>= 3.0.0),
                      python-oslo.policy (>= 0.5.0),
-                     python-oslo.reports,
+                     python-oslo.reports (>= 1.0.0),
                      python-oslo.rootwrap (>= 2.0.0),
-                     python-oslo.serialization (>= 1.4.0),
-                     python-oslo.service (>= 0.8.0),
-                     python-oslo.utils (>= 2.0.0),
-                     python-oslo.versionedobjects (>= 0.6.0),
+                     python-oslo.serialization (>= 2.0.0),
+                     python-oslo.service (>= 1.0.0),
+                     python-oslo.utils (>= 3.4.0),
+                     python-oslo.versionedobjects (>= 1.0.0),
                      python-oslo.vmware (>= 1.16.0),
                      python-oslosphinx (>= 2.5.0),
                      python-oslotest (>= 1.10.0),
@@ -60,20 +60,23 @@ Build-Depends-Indep: bandit (>= 0.13.2),
                      python-paste,
                      python-pastedeploy,
                      python-psutil,
-                     python-psycopg2,
+                     python-psycopg2 (>= 2.5),
                      python-pymysql,
                      python-pyparsing,
-                     python-requests (>= 2.5.2),
+                     python-requests (>= 2.8.1),
                      python-retrying,
                      python-routes,
                      python-rtslib-fb (>= 2.1.57),
                      python-six (>= 1.9.0),
-                     python-sqlalchemy (>= 0.9.7),
+                     python-sqlalchemy (>= 1.0.10),
                      python-stevedore (>= 1.5.0),
                      python-swiftclient (>= 1:2.2.0),
-                     python-taskflow (>= 1.16.0),
-                     python-tempest-lib (>= 0.6.1),
+                     python-taskflow (>= 1.25.0),
+                     python-tempest-lib (>= 0.13.0),
+                     python-testresources,
+                     python-testscenarios,
                      python-testtools (>= 1.4.0),
+                     python-tooz,
                      python-webob,
                      subunit,
                      testrepository,
@@ -87,59 +90,56 @@ Section: python
 Architecture: all
 Depends: python-anyjson,
          python-babel,
-         python-barbicanclient (>= 3.0.1),
+         python-barbicanclient (>= 3.3.0),
          python-ceph,
          python-crypto,
          python-eventlet (>= 0.17.4),
-         python-glanceclient (>= 1:0.18.0),
+         python-glanceclient (>= 1:1.2.0),
          python-greenlet,
          python-hp3parclient,
          python-iso8601,
-         python-keystonemiddleware (>= 2.0.0),
-         python-kombu,
+         python-keystonemiddleware (>= 4.0.0),
          python-lxml,
          python-migrate (>= 0.9.6),
          python-mysqldb,
-         python-netaddr (>= 0.7.12),
-         python-novaclient (>= 2:2.26.0),
-         python-os-brick (>= 0.3.2),
+         python-novaclient (>= 2:2.29.0),
+         python-os-brick (>= 0.4.0),
+         python-os-win,
          python-oslo.concurrency (>= 2.3.0),
-         python-oslo.config (>= 1:2.1.0),
+         python-oslo.config (>= 1:3.2.0),
          python-oslo.context (>= 0.2.0),
-         python-oslo.db (>= 2.4.1),
+         python-oslo.db (>= 4.1.0),
          python-oslo.i18n (>= 1.5.0),
-         python-oslo.log (>= 1.8.0),
-         python-oslo.messaging (>= 1.16.0),
-         python-oslo.middleware (>= 2.4.0),
+         python-oslo.log (>= 2.0.0),
+         python-oslo.messaging (>= 3.0.0),
+         python-oslo.middleware (>= 3.0.0),
          python-oslo.policy (>= 0.5.0),
-         python-oslo.reports,
+         python-oslo.reports (>= 1.0.0),
          python-oslo.rootwrap (>= 2.0.0),
-         python-oslo.serialization (>= 1.4.0),
-         python-oslo.service (>= 0.8.0),
-         python-oslo.utils (>= 2.0.0),
-         python-oslo.versionedobjects (>= 0.6.0),
+         python-oslo.serialization (>= 2.0.0),
+         python-oslo.service (>= 1.0.0),
+         python-oslo.utils (>= 3.4.0),
+         python-oslo.versionedobjects (>= 1.0.0),
          python-oslo.vmware (>= 1.16.0),
          python-osprofiler (>= 0.3.0),
          python-paramiko (>= 1.13.0),
          python-paste,
          python-pastedeploy,
-         python-pbr (>= 1.6),
+         python-pbr (>= 1.8),
          python-psutil,
-         python-psycopg2,
+         python-psycopg2 (>= 2.5),
          python-pymysql,
          python-pyparsing,
-         python-requests (>= 2.5.2),
+         python-requests (>= 2.8.1),
          python-retrying,
          python-routes,
          python-rtslib-fb (>= 2.1.57),
          python-six (>= 1.9.0),
-         python-sqlalchemy (>= 0.9.7),
+         python-sqlalchemy (>= 1.0.10),
          python-stevedore (>= 1.5.0),
          python-swiftclient (>= 1:2.2.0),
-         python-taskflow (>= 1.16.0),
+         python-taskflow (>= 1.25.0),
          python-webob,
-         ${misc:Depends},
-         ${python:Depends},
 Description: OpenStack block storage system - Python libraries
  Cinder is a block Storage-as-a-Service system for the OpenStack cloud
  computing suite. It re-implements the features of Nova-volume, which it
@@ -181,6 +181,8 @@ Depends: adduser,
          cinder-common (= ${binary:Version}),
          debconf,
          python-keystoneclient,
+         python-openstackclient,
+         q-text-as-data,
          ${misc:Depends},
          ${ostack-lsb-base},
          ${python:Depends},
index 7da944a9d0264f223053c1bd3ae0723caa42b81f..c737cbbfb6d7a8df6ccb41a5d9bf6f3397635a49 100644 (file)
@@ -1,6 +1,6 @@
 [DEFAULT]
 upstream-branch = master
-debian-branch = debian/liberty
+debian-branch = debian/mitaka
 upstream-tag = %(version)s
 compression = xz
 
diff --git a/trusty/debian/gen-fixed-config b/trusty/debian/gen-fixed-config
new file mode 100755 (executable)
index 0000000..4ba11bc
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+set -x
+
+#tools/config/generate_sample.sh
+
+DESTIN=debian/cinder-common/usr/share/cinder-common/cinder.conf
+sed -i 's/^[ \t#]*enabled_backends[ \t]*=.*/enabled_backends = lvm/' ${DESTIN}
+
+echo "[lvm]
+volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
+volume_group = pkgosvg0
+iscsi_protocol = iscsi
+iscsi_helper = tgtadm  
+" >>${DESTIN}
diff --git a/trusty/debian/patches/Missing_configuration_opts_from_cinder.sample.conf.patch b/trusty/debian/patches/Missing_configuration_opts_from_cinder.sample.conf.patch
new file mode 100644 (file)
index 0000000..456d85d
--- /dev/null
@@ -0,0 +1,276 @@
+Subject: Missing configuration opts from cinder.sample.conf
+ The logic for writing opts registered with register_opt() to the
+ auto-generated opts.py file was flawed in that the directories where
+ there were opts being registered with this method would be imported,
+ but the actual opt would be missed when looking through the file for
+ the name of the opt being registered. Now the singular opts are being
+ caught and written to opts.py for the oslo-config-generator to process.
+ .
+ The 'backend' section was added to generate_cinder_opts.py
+ due to some of the missing opts being a part of that section.
+ .
+ Also the way some of the opts that were being registered with groups
+ were incorrect and so this addresses those in both how they were
+ processed in generate_cinder_opts.py and the files in which they are being
+ registered.
+ .
+ There is also one change to the name of an opt in cinder/volume/api.py.
+ Instances such as this one will be caught by the in-progress hacking
+ check patch: https://review.openstack.org/#/c/223375/
+Author: Kendall Nelson <kjnelson@us.ibm.com>
+Date: Mon, 21 Sep 2015 18:11:19 +0000 (-0500)
+X-Git-Url: https://review.openstack.org/gitweb?p=openstack%2Fcinder.git;a=commitdiff_plain;h=10f5e92e1246dd33b244c4a7031bb81b17b240a3
+Change-Id: I8d333d7529d40f3a3b3651ca3a52c0048d96b99a
+Bug-Ubuntu: https://bugs.launchpad.net/cinder/+bug/1498122
+Origin: upstream, https://review.openstack.org/#/c/225974/
+Last-Update: 2015-09-01
+
+diff --git a/cinder/config/generate_cinder_opts.py b/cinder/config/generate_cinder_opts.py
+index 9fa8d13..50c206b 100644
+--- a/cinder/config/generate_cinder_opts.py
++++ b/cinder/config/generate_cinder_opts.py
+@@ -19,6 +19,8 @@ if __name__ == "__main__":
+     opt_file = open("cinder/opts.py", 'a')
+     opt_dict = {}
+     dir_trees_list = []
++    REGISTER_OPTS_STR = "CONF.register_opts("
++    REGISTER_OPT_STR = "CONF.register_opt("
+     opt_file.write("import copy\n")
+     opt_file.write("import itertools\n\n")
+@@ -31,11 +33,11 @@ if __name__ == "__main__":
+                      '+  | sed -e "s/^' + basedir +
+                      '\///g" | sort -u')
+-    cmd_opts = common_string % "CONF.register_opts("
++    cmd_opts = common_string % REGISTER_OPTS_STR
+     output_opts = subprocess.check_output('{}'.format(cmd_opts), shell = True)
+     dir_trees_list = output_opts.split()
+-    cmd_opt = common_string % "CONF.register_opt("
++    cmd_opt = common_string % REGISTER_OPT_STR
+     output_opt = subprocess.check_output('{}'.format(cmd_opt), shell = True)
+     temp_list = output_opt.split()
+@@ -84,21 +86,29 @@ if __name__ == "__main__":
+                             'BRCD_FABRIC_EXAMPLE': [],
+                             'CISCO_FABRIC_EXAMPLE': [],
+                             'profiler': [],
++                            'backend': [],
+                             'DEFAULT': [], }
+     def _write_item(opts):
+         list_name = opts[-3:]
+-        if list_name.lower() == "opts":
++        if list_name.lower() == "opt":
+             opt_file.write("            [" + opts.strip("\n") + "],\n")
+         else:
+             opt_file.write("            " + opts.strip("\n") + ",\n")
++    def _retrieve_name(aline):
++        if REGISTER_OPT_STR in aline:
++            str_to_replace = REGISTER_OPT_STR
++        else:
++            str_to_replace = REGISTER_OPTS_STR
++        return aline.replace(str_to_replace, "")
++
+     for key in opt_dict:
+         fd = os.open(opt_dict[key], os.O_RDONLY)
+         afile = os.fdopen(fd, "r")
+         for aline in afile:
+-            exists = aline.find("CONF.register_opts(")
++            exists = aline.find("CONF.register_opt")
+             if exists != -1:
+                 # TODO(kjnelson) FIX THIS LATER. These are instances where
+                 # CONF.register_opts is happening without actually registering
+@@ -109,41 +119,48 @@ if __name__ == "__main__":
+                     continue
+                 if aline.find("fc-zone-manager") != -1:
+-                    fc_zm_list = aline.replace("CONF.register_opts(", '')
+-                    fc_zm_list = fc_zm_list.replace(", 'fc-zone-manager')", '')
+-                    fc_zm_list.strip()
++                    fc_zm_list = _retrieve_name(aline)
++                    replace_string = ", group='fc-zone-manager')"
++                    fc_zm_list = fc_zm_list.replace(replace_string, '')
++                    fc_zm_list = fc_zm_list.strip()
+                     line = key + "." + fc_zm_list
+                     registered_opts_dict['fc-zone-manager'].append(line)
+                 elif aline.find("keymgr") != -1:
+-                    keymgr_list = aline.replace("CONF.register_opts(", '')
++                    keymgr_list = _retrieve_name(aline)
+                     keymgr_list = keymgr_list.replace(", group='keymgr')", '')
+-                    keymgr_list = keymgr_list.replace(", 'keymgr')", '')
+-                    keymgr_list.strip()
++                    keymgr_list = keymgr_list.strip()
+                     line = key + "." + keymgr_list
+                     registered_opts_dict['keymgr'].append(line)
+                 elif aline.find("BRCD_FABRIC_EXAMPLE") != -1:
+-                    brcd_list = aline.replace("CONF.register_opts(", '')
+-                    replace_string = ", 'BRCD_FABRIC_EXAMPLE')"
++                    brcd_list = _retrieve_name(aline)
++                    replace_string = ", group='BRCD_FABRIC_EXAMPLE')"
+                     brcd_list = brcd_list.replace(replace_string, '')
+-                    brcd_list.strip()
++                    brcd_list = brcd_list.strip()
+                     line = key + "." + brcd_list
+                     registered_opts_dict['BRCD_FABRIC_EXAMPLE'].append(line)
+                 elif aline.find("CISCO_FABRIC_EXAMPLE") != -1:
+-                    cisco_list = aline.replace("CONF.register_opts(", '')
+-                    replace_string = ", 'CISCO_FABRIC_EXAMPLE')"
++                    cisco_list = _retrieve_name(aline)
++                    replace_string = ", group='CISCO_FABRIC_EXAMPLE')"
+                     cisco_list = cisco_list.replace(replace_string, '')
+-                    cisco_list.strip()
++                    cisco_list = cisco_list.strip()
+                     line = key + "." + cisco_list
+                     registered_opts_dict['CISCO_FABRIC_EXAMPLE'].append(line)
+                 elif aline.find("profiler") != -1:
+-                    profiler_list = aline.replace("CONF.register_opts(", '')
++                    profiler_list = _retrieve_name(aline)
+                     replace_string = ', group="profiler")'
+                     profiler_list = profiler_list.replace(replace_string, '')
+-                    profiler_list.strip()
++                    profiler_list = profiler_list.strip()
+                     line = key + "." + profiler_list
+                     registered_opts_dict['profiler'].append(line)
++                elif aline.find("backend") != -1:
++                    backend_list = _retrieve_name(aline)
++                    replace_string = ', group=backend)'
++                    backend_list = backend_list.replace(replace_string, '')
++                    backend_list = backend_list.strip()
++                    line = key + "." + backend_list
++                    registered_opts_dict['backend'].append(line)
+                 else:
+-                    default_list = aline.replace("CONF.register_opts(", '')
++                    default_list = _retrieve_name(aline)
+                     default_list = default_list.replace(')', '').strip()
+                     line = key + "." + default_list
+                     registered_opts_dict['DEFAULT'].append(line)
+@@ -166,6 +183,14 @@ if __name__ == "__main__":
+     for item in registered_opts_dict["profiler"]:
+         _write_item(item)
++    backend_str = ("    )),\n"
++                   "    ('backend',\n"
++                   "    itertools.chain(\n")
++    opt_file.write(backend_str)
++
++    for item in registered_opts_dict["backend"]:
++        _write_item(item)
++
+     cisco_str = ("    )),\n"
+                  "    ('CISCO_FABRIC_EXAMPLE',\n"
+                  "    itertools.chain(\n")
+diff --git a/cinder/keymgr/key_mgr.py b/cinder/keymgr/key_mgr.py
+index 4d8bbdb..71ed7a7 100644
+--- a/cinder/keymgr/key_mgr.py
++++ b/cinder/keymgr/key_mgr.py
+@@ -32,7 +32,7 @@ encryption_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(encryption_opts, 'keymgr')
++CONF.register_opts(encryption_opts, group='keymgr')
+ @six.add_metaclass(abc.ABCMeta)
+diff --git a/cinder/volume/api.py b/cinder/volume/api.py
+index 03f1d74..5db3a7b 100644
+--- a/cinder/volume/api.py
++++ b/cinder/volume/api.py
+@@ -52,12 +52,13 @@ from cinder.volume import utils as volume_utils
+ from cinder.volume import volume_types
+-allow_force_upload = cfg.BoolOpt('enable_force_upload',
+-                                 default=False,
+-                                 help='Enables the Force option on '
+-                                      'upload_to_image. This enables '
+-                                      'running upload_volume on in-use '
+-                                      'volumes for backends that support it.')
++allow_force_upload_opt = cfg.BoolOpt('enable_force_upload',
++                                     default=False,
++                                     help='Enables the Force option on '
++                                          'upload_to_image. This enables '
++                                          'running upload_volume on in-use '
++                                          'volumes for backends that '
++                                          'support it.')
+ volume_host_opt = cfg.BoolOpt('snapshot_same_host',
+                               default=True,
+                               help='Create volume from snapshot at the host '
+@@ -73,7 +74,7 @@ az_cache_time_opt = cfg.IntOpt('az_cache_duration',
+                                     'seconds')
+ CONF = cfg.CONF
+-CONF.register_opt(allow_force_upload)
++CONF.register_opt(allow_force_upload_opt)
+ CONF.register_opt(volume_host_opt)
+ CONF.register_opt(volume_same_az_opt)
+ CONF.register_opt(az_cache_time_opt)
+diff --git a/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py b/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py
+index 6c1276a..26c8fbe 100644
+--- a/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py
++++ b/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py
+@@ -50,7 +50,7 @@ brcd_zone_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(brcd_zone_opts, 'BRCD_FABRIC_EXAMPLE')
++CONF.register_opts(brcd_zone_opts, group='BRCD_FABRIC_EXAMPLE')
+ LOG = logging.getLogger(__name__)
+diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
+index 696af1f..506888d 100644
+--- a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
++++ b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
+@@ -52,7 +52,7 @@ brcd_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(brcd_opts, 'fc-zone-manager')
++CONF.register_opts(brcd_opts, group='fc-zone-manager')
+ class BrcdFCZoneDriver(fc_zone_driver.FCZoneDriver):
+diff --git a/cinder/zonemanager/drivers/cisco/cisco_fabric_opts.py b/cinder/zonemanager/drivers/cisco/cisco_fabric_opts.py
+index c105b31..0aa0cea 100644
+--- a/cinder/zonemanager/drivers/cisco/cisco_fabric_opts.py
++++ b/cinder/zonemanager/drivers/cisco/cisco_fabric_opts.py
+@@ -47,7 +47,7 @@ cisco_zone_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(cisco_zone_opts, 'CISCO_FABRIC_EXAMPLE')
++CONF.register_opts(cisco_zone_opts, group='CISCO_FABRIC_EXAMPLE')
+ def load_fabric_configurations(fabric_names):
+diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py
+index 98d4535..85d69b6 100644
+--- a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py
++++ b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py
+@@ -50,7 +50,7 @@ cisco_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(cisco_opts, 'fc-zone-manager')
++CONF.register_opts(cisco_opts, group='fc-zone-manager')
+ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
+diff --git a/cinder/zonemanager/fc_zone_manager.py b/cinder/zonemanager/fc_zone_manager.py
+index ecbbe23..011890b 100644
+--- a/cinder/zonemanager/fc_zone_manager.py
++++ b/cinder/zonemanager/fc_zone_manager.py
+@@ -64,7 +64,7 @@ zone_manager_opts = [
+ ]
+ CONF = cfg.CONF
+-CONF.register_opts(zone_manager_opts, 'fc-zone-manager')
++CONF.register_opts(zone_manager_opts, group='fc-zone-manager')
+ class ZoneManager(fc_common.FCCommon):
index 3aa30135b6de1ad30fd6f043e7eb5ecc220b9c67..98f65931c4c84991b6fa555a19e7674cdf70c761 100644 (file)
@@ -1,2 +1 @@
 babel
-suds-jurko python-suds
index 2274bccda5d5d8dd50aa6dba715b45a050af4e19..bd5b793c86a676f7ec5b0171c849dd093138d386 100755 (executable)
@@ -3,6 +3,8 @@
 include /usr/share/openstack-pkg-tools/pkgos.make
 export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)
 
+export DH_VERBOSE=1
+
 %:
        dh $@ --buildsystem=python_distutils --with python2,systemd,sphinxdoc
 
@@ -31,33 +33,57 @@ override_dh_install:
        dh_install --fail-missing -Xbin/cinder-all
        install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
 
-       oslo-config-generator --output-file $(CURDIR)/etc/cinder/cinder.conf.sample \
-               --wrap-width 140 \
-               --namespace cinder \
-               --namespace oslo_concurrency \
-               --namespace oslo_db \
-               --namespace oslo_messaging \
-               --namespace cinder.policy \
-               --namespace keystonemiddleware.auth_token \
-               --namespace cinder.openstack.common.eventlet_backdoor \
-               --namespace cinder.openstack.common.log \
-               --namespace cinder.openstack.common.periodic_task \
-               --namespace cinder.openstack.common.policy \
-               --namespace oslo_db.concurrency
-       install -D -m 0644 $(CURDIR)/etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       mkdir -p $(CURDIR)/debian/cinder-common/usr/share/cinder-common
+       $(CURDIR)/tools/config/generate_sample.sh from_tox
+#      PYTHONPATH=. oslo-config-generator --output-file $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf \
+#              --wrap-width 80 \
+#              --namespace cinder \
+#              --namespace keystonemiddleware.auth_token \
+#              --namespace oslo.config \
+#              --namespace oslo.concurrency \
+#              --namespace oslo.context \
+#              --namespace oslo.db \
+#              --namespace oslo.i18n \
+#              --namespace oslo.log \
+#              --namespace oslo.messaging \
+#              --namespace oslo.middleware \
+#              --namespace oslo.policy \
+#              --namespace oslo.reports \
+#              --namespace oslo.rootwrap \
+#              --namespace oslo.serialization \
+#              --namespace oslo.service \
+#              --namespace oslo.utils \
+#              --namespace oslo.versionedobjects \
+#              --namespace oslo.vmware
+       # The generator is currently missing enabled_backend and the [lvm]
+       # section. This script fixes it until upstream gets smarter.
+#      chmod +x debian/gen-fixed-config
+#      ./debian/gen-fixed-config
+       cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+
+       # Set LVM as default backend
+       sed -i 's/^[ \t#]*enabled_backends[ \t]*=.*/enabled_backends = lvm/' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       echo "[lvm]"                            >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       echo "volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver" >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       echo "volume_group = pkgosvg0"          >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       echo "iscsi_protocol = iscsi"           >> $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       echo "iscsi_helper = tgtadm"            >> $(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/#auth_protocol=https/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
-       echo "sql_connection = sqlite:////var/lib/cinder/cinderdb" >>$(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       #echo "# Connection to db:" >>$(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       #echo "sql_connection = sqlite:////var/lib/cinder/cinderdb" >>$(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
 
        install -D -m 0644 $(CURDIR)/etc/cinder/logging_sample.conf $(CURDIR)/debian/cinder-common/usr/share/cinder-common/logging.conf