]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixed config file generation.
authorThomas Goirand <thomas@goirand.fr>
Tue, 2 Feb 2016 05:35:32 +0000 (05:35 +0000)
committerThomas Goirand <thomas@goirand.fr>
Tue, 2 Feb 2016 06:07:14 +0000 (06:07 +0000)
Rewritten-From: 69479bbaa78988c911fcf80a25c545de48273e55

xenial/debian/changelog
xenial/debian/control
xenial/debian/patches/remove-zfssa-from-opts.py.patch [new file with mode: 0644]
xenial/debian/patches/series
xenial/debian/rules

index 53fff21bb0c989577401847d02ea7e2f1c5518fb..920541ff0420aba5f7354daf5f57f7c7080a03e8 100644 (file)
@@ -2,6 +2,7 @@ cinder (2:8.0.0~b2-2) UNRELEASED; urgency=medium
 
   * New (build-)depends on python-oauth2client to ensure version.
   * Added missing build-depends on git, needed by sphinx-build.
+  * Fixed config file generation.
 
  -- Thomas Goirand <zigo@debian.org>  Mon, 25 Jan 2016 10:02:39 +0000
 
index a00c93f47a533b6e600786c96dcfe153c4980b24..7dbacd925db56418463e0c029794e631ec4dee1c 100644 (file)
@@ -6,7 +6,7 @@ Uploaders: Thomas Goirand <zigo@debian.org>,
 Build-Depends: debhelper (>= 9),
                dh-python,
                dh-systemd,
-               openstack-pkg-tools (>= 23~),
+               openstack-pkg-tools (>= 38~),
                po-debconf,
                python-all,
                python-pbr (>= 1.8),
diff --git a/xenial/debian/patches/remove-zfssa-from-opts.py.patch b/xenial/debian/patches/remove-zfssa-from-opts.py.patch
new file mode 100644 (file)
index 0000000..99f872a
--- /dev/null
@@ -0,0 +1,34 @@
+Description: Remove zfssa from opts.py
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2016-01-02
+
+--- cinder-8.0.0~b2.orig/cinder/opts.py
++++ cinder-8.0.0~b2/cinder/opts.py
+@@ -158,10 +158,6 @@ from cinder.volume.drivers import vzstor
+ from cinder.volume.drivers.windows import windows as \
+     cinder_volume_drivers_windows_windows
+ from cinder.volume.drivers import xio as cinder_volume_drivers_xio
+-from cinder.volume.drivers.zfssa import zfssaiscsi as \
+-    cinder_volume_drivers_zfssa_zfssaiscsi
+-from cinder.volume.drivers.zfssa import zfssanfs as \
+-    cinder_volume_drivers_zfssa_zfssanfs
+ from cinder.volume import manager as cinder_volume_manager
+ from cinder.wsgi import eventlet_server as cinder_wsgi_eventletserver
+ from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as \
+@@ -268,7 +264,6 @@ def list_opts():
+                 cinder_volume_drivers_xio.XIO_OPTS,
+                 cinder_volume_drivers_ibm_storwize_svc_storwizesvcfc.
+                 storwize_svc_fc_opts,
+-                cinder_volume_drivers_zfssa_zfssaiscsi.ZFSSA_OPTS,
+                 cinder_volume_driver.volume_opts,
+                 cinder_volume_driver.iser_opts,
+                 cinder_api_views_versions.versions_opts,
+@@ -309,7 +304,6 @@ def list_opts():
+                 cinder_volume_drivers_blockbridge.blockbridge_opts,
+                 [cinder_scheduler_scheduleroptions.
+                     scheduler_json_config_location_opt],
+-                cinder_volume_drivers_zfssa_zfssanfs.ZFSSA_OPTS,
+                 cinder_volume_drivers_disco_disco.disco_opts,
+                 cinder_volume_drivers_hgst.hgst_opts,
+                 cinder_image_imageutils.image_helper_opts,
index 75399ed0474744ffd7d0a27773496cf9057e014e..f85536fc6ee7308c4707ecf5feaeb5e45374bedb 100644 (file)
@@ -1,2 +1,3 @@
 install-missing-files.patch
 no-zfssa-tests.patch
+remove-zfssa-from-opts.py.patch
index 829a3405457070bc1ea380e8dd0f0ced766bd2f8..03c5a2ab6649a3a60bb1fc40bc61b6e2ed33c4d8 100755 (executable)
@@ -27,63 +27,59 @@ override_dh_clean:
        rm -f debian/cinder-common.config debian/cinder-common.postinst debian/cinder-api.config debian/cinder-api.postinst debian/cinder-volume.postinst
        rm -rf debian/*.upstart debian/*.service
 
+override_dh_auto_install:
+       echo "Do nothing..."
+
 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
+       python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
 
        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.
+       PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages 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
+#      cp etc/cinder/cinder.conf.sample $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+
+       dh_install --fail-missing -Xbin/cinder-all
+       install -D -m 0440 debian/cinder-common.sudoers $(CURDIR)/debian/cinder-common/etc/sudoers.d/cinder-common
 
        # 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
+       pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf DEFAULT enabled_backends lvm
        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
+       # Set a default value for lock_path & state_path
+       pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf oslo_concurrency lock_path /var/lock/cinder
 
        # Disable https in default setup, as this makes our CI fail
-       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|#[ \t#]*state_path[ \t]*=.*|state_path=/var/lib/cinder|' $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf
+       pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf keystone_authtoken auth_protocol http
 
        # 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
-
-       install -D -m 0644 $(CURDIR)/etc/cinder/logging_sample.conf $(CURDIR)/debian/cinder-common/usr/share/cinder-common/logging.conf
+       pkgos-fix-config-default $(CURDIR)/debian/cinder-common/usr/share/cinder-common/cinder.conf database sqlite:////var/lib/cinder/cinderdb
 
 override_dh_fixperms:
        dh_fixperms -Xcinder_tgt.conf