]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Move cinder to 8.0 branch 85/13585/2
authordtrishkin <dtrishkin@mirantis.com>
Mon, 2 Nov 2015 15:37:45 +0000 (18:37 +0300)
committerArtem Silenkov <asilenkov@mirantis.com>
Mon, 2 Nov 2015 21:12:13 +0000 (21:12 +0000)
Change-Id: I089b211039ee0c2070f1969b8883db04d08fc75d

17 files changed:
centos7/rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch [moved from rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch with 100% similarity]
centos7/rpm/SOURCES/cinder-dist.conf [moved from rpm/SOURCES/cinder-dist.conf with 100% similarity]
centos7/rpm/SOURCES/cinder-sudoers [moved from rpm/SOURCES/cinder-sudoers with 100% similarity]
centos7/rpm/SOURCES/cinder-tgt.conf [moved from rpm/SOURCES/cinder-tgt.conf with 100% similarity]
centos7/rpm/SOURCES/cinder.conf.sample [moved from rpm/SOURCES/cinder.conf.sample with 100% similarity]
centos7/rpm/SOURCES/cinder.logrotate [moved from rpm/SOURCES/cinder.logrotate with 100% similarity]
centos7/rpm/SOURCES/openstack-cinder-api.init [moved from rpm/SOURCES/openstack-cinder-api.init with 100% similarity]
centos7/rpm/SOURCES/openstack-cinder-api.service [new file with mode: 0644]
centos7/rpm/SOURCES/openstack-cinder-backup.init [moved from rpm/SOURCES/openstack-cinder-backup.init with 100% similarity]
centos7/rpm/SOURCES/openstack-cinder-backup.service [new file with mode: 0644]
centos7/rpm/SOURCES/openstack-cinder-scheduler.init [moved from rpm/SOURCES/openstack-cinder-scheduler.init with 100% similarity]
centos7/rpm/SOURCES/openstack-cinder-scheduler.service [new file with mode: 0644]
centos7/rpm/SOURCES/openstack-cinder-volume.init [moved from rpm/SOURCES/openstack-cinder-volume.init with 100% similarity]
centos7/rpm/SOURCES/openstack-cinder-volume.service [new file with mode: 0644]
centos7/rpm/SPECS/openstack-cinder.spec [moved from rpm/SPECS/openstack-cinder.spec with 79% similarity]
rpm/SOURCES/openstack-cinder-volume-vmware.init [deleted file]
tests/runtests.sh

diff --git a/centos7/rpm/SOURCES/openstack-cinder-api.service b/centos7/rpm/SOURCES/openstack-cinder-api.service
new file mode 100644 (file)
index 0000000..4d7b4b3
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Cinder API Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-api --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/api.log
+
+[Install]
+WantedBy=multi-user.target
diff --git a/centos7/rpm/SOURCES/openstack-cinder-backup.service b/centos7/rpm/SOURCES/openstack-cinder-backup.service
new file mode 100644 (file)
index 0000000..e1b2548
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenStack Cinder Backup Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-backup --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/backup.log
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/centos7/rpm/SOURCES/openstack-cinder-scheduler.service b/centos7/rpm/SOURCES/openstack-cinder-scheduler.service
new file mode 100644 (file)
index 0000000..e791662
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenStack Cinder Scheduler Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-scheduler --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/scheduler.log
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/centos7/rpm/SOURCES/openstack-cinder-volume.service b/centos7/rpm/SOURCES/openstack-cinder-volume.service
new file mode 100644 (file)
index 0000000..d274bae
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Cinder Volume Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=cinder
+ExecStart=/usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log
+
+[Install]
+WantedBy=multi-user.target
similarity index 79%
rename from rpm/SPECS/openstack-cinder.spec
rename to centos7/rpm/SPECS/openstack-cinder.spec
index 8f726bd67c26f328f6215406a9dcd5672d3ceb28..0e72d89d1ea2e2a454f6a1a20e690f64b2b604d7 100644 (file)
@@ -1,14 +1,15 @@
 %global with_doc %{!?_without_doc:1}%{?_without_doc:0}
 
 Name:             openstack-cinder
-Version:          2014.2
-Release:          2%{?dist}
+Epoch:            1
+Version:          7.0.0.0rc1
+Release:          1%{?dist}~mos8.0.1
 Summary:          OpenStack Volume service
 
 Group:            Applications/System
 License:          ASL 2.0
 URL:              http://www.openstack.org/software/openstack-storage/
-Source0:          https://launchpad.net/cinder/icehouse/2014.1/+download/cinder-%{version}.tar.gz
+Source0:          cinder-%{version}.tar.gz
 Source1:          cinder-dist.conf
 Source2:          cinder.logrotate
 Source3:          cinder-tgt.conf
@@ -18,7 +19,11 @@ Source11:         openstack-cinder-scheduler.init
 Source12:         openstack-cinder-volume.init
 Source13:         openstack-cinder-backup.init
 Source14:         cinder.conf.sample
-Source15:         openstack-cinder-volume-vmware.init
+
+Source30:         openstack-cinder-api.service
+Source31:         openstack-cinder-scheduler.service
+Source32:         openstack-cinder-volume.service
+Source33:         openstack-cinder-backup.service
 
 
 Source20:         cinder-sudoers
@@ -36,9 +41,10 @@ BuildRequires:    python-pbr
 BuildRequires:    python-sphinx
 BuildRequires:    python-setuptools
 BuildRequires:    python-netaddr >= 0.7.12
+BuildRequires:    python-stevedore
 
-Requires:         openstack-utils
-Requires:         python-cinder = %{version}-%{release}
+#Requires:         openstack-utils
+Requires:         python-cinder = 1:%{version}-%{release}
 
 # as convenience
 Requires:         python-cinderclient
@@ -49,7 +55,8 @@ Requires(preun):  chkconfig
 Requires(pre):    shadow-utils
 
 Requires:         lvm2
-Requires:         scsi-target-utils
+#Requires:         scsi-target-utils
+Requires:         iscsi-initiator-utils
 
 %description
 OpenStack Volume (codename Cinder) provides services to manage and
@@ -67,50 +74,62 @@ Requires:         MySQL-python
 Requires:         qemu-img
 Requires:         sysfsutils
 
-Requires:         python-pbr >= 0.6, python-pbr < 0.7, python-pbr > 0.7, python-pbr < 1.0
+Requires:         python-pbr >= 1.6
 Requires:         python-anyjson >= 0.3.3
 Requires:         python-argparse
 Requires:         python-babel >= 1.3
-Requires:         python-eventlet >= 0.15.2
+Requires:         python-enum34
+Requires:         python-eventlet >= 0.17.4
 Requires:         python-greenlet >= 0.3.2
 Requires:         python-iso8601 >= 0.1.9
-Requires:         python-keystonemiddleware >= 1.0.0
-Requires:         python-kombu >= 2.5.0
+Requires:         python-keystoneclient >= 1:1.6.0
+Requires:         python-keystonemiddleware >= 2.0.0
+Requires:         python-kombu >= 3.0.7
 Requires:         python-lxml >= 2.3
 Requires:         python-netaddr >= 0.7.12
-Requires:         python-oslo-config >= 1:1.4.0
-Requires:         python-oslo.concurrency >= 0.3.0
-Requires:         python-oslo-db >= 1.1.0
-Requires:         python-oslo-messaging >= 1.4.0, python-oslo.messaging < 1.5.0, python-oslo.messaging > 1.5.0
-Requires:         python-oslo-rootwrap >= 1.3.0
-Requires:         python-oslo.serialization >= 1.0.0
-Requires:         python-oslo.utils >= 1.0.0
+Requires:         python-oslo-config >= 1:2.3.0
+Requires:         python-oslo-concurrency >= 2.3.0
+Requires:         python-oslo-context >= 0.2.0
+Requires:         python-oslo-db >= 2.4.1
+Requires:         python-oslo-log >= 1.8.0
+Requires:         python-oslo-messaging >= 1.16.0
+Requires:         python-oslo-middleware >= 2.8.0
+Requires:         python-oslo-policy >= 0.5.0
+Requires:         python-oslo-reports >= 0.1.0
+Requires:         python-oslo-rootwrap >= 2.0.0
+Requires:         python-oslo-serialization >= 1.4.0
+Requires:         python-oslo-utils >= 2.0.0
+Requires:         python-oslo-versionedobjects >= 0.9.0
 Requires:         python-osprofiler >= 0.3.0
 Requires:         python-paramiko >= 1.13.0
+Requires:         python-paste
 Requires:         python-paste-deploy >= 1.5.0
 Requires:         python-crypto >= 2.6
-Requires:         python-barbicanclient >= 2.1.0, python-barbicanclient < 3.0.0, python-barbicanclient > 3.0.0
-Requires:         python-glanceclient >= 1:0.14.0
-Requires:         python-novaclient >= 1:2.18.0
+Requires:         pyparsing >= 2.0.3
+Requires:         python-barbicanclient >= 3.3.0
+Requires:         python-glanceclient >= 1:0.18.0
+Requires:         python-novaclient >= 1:2.28.0
 Requires:         python-swiftclient >= 2.2.0
-Requires:         python-requests >= 2.2.0, python-requests < 2.4.0, python-requests > 2.4.0
-Requires:         python-routes >= 1.12.3, python-routes < 2.0, python-routes > 2.0
-Requires:         python-taskflow >= 0.4
-Requires:         python-rtslib-fb >= 2.1.fb39
-Requires:         python-six >= 1.7.0
-Requires:         python-sqlalchemy  >= 0.9.7, python-sqlalchemy <= 0.9.99
-Requires:         python-migrate >= 0.9.1, python-migrate < 0.9.2, python-migrate > 0.9.2
-Requires:         python-stevedore >= 1.1.0
-Requires:         python-suds >= 0.4
+Requires:         python-requests >= 2.5.2
+Requires:         python-retrying >= 1.2.3
+Requires:         python-routes >= 1.12.3
+Requires:         python-taskflow >= 1.16
+Requires:         python-rtslib >= 2.1.fb41
+Requires:         python-six >= 1.9.0
+Requires:         python-sqlalchemy  >= 0.9.9
+Requires:         python-migrate >= 0.9.6
+Requires:         python-stevedore >= 1.5.0
+Requires:         python-suds-jurko >= 0.6
 Requires:         python-webob >= 1.2.3
-Requires:         python-wsgiref >= 0.1.2
-Requires:         python-oslo.i18n >= 1.0.0
-
-Requires:         python-qpid
-Requires:         python-amqplib
-Requires:         python-keystoneclient >= 1:0.10.0
-Requires:         python-lockfile
-Requires:         python-ceph
+Requires:         python-oslo-i18n >= 1.5.0
+Requires:         python-oslo-vmware >= 1.16.0
+
+Requires:        os-brick >= 0.4.0
+
+#Requires:         python-qpid
+#Requires:         python-amqplib
+#Requires:         python-lockfile
+#Requires:         python-ceph
 #Requires:         iscsi-initiator-utils
 
 %description -n   python-cinder
@@ -124,7 +143,7 @@ This package contains the cinder Python library.
 Summary:          Documentation for OpenStack Volume
 Group:            Documentation
 
-Requires:         %{name} = %{version}-%{release}
+Requires:         %{name} = 1:%{version}-%{release}
 
 BuildRequires:    graphviz
 
@@ -198,18 +217,25 @@ install -d -m 755 %{buildroot}%{_localstatedir}/log/cinder
 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder
 install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/cinder/cinder-dist.conf
 install -p -D -m 640 %{SOURCE14}  %{buildroot}%{_sysconfdir}/cinder/cinder.conf
-install -p -D -m 755 %{SOURCE15} %{buildroot}%{_datadir}/cinder/openstack-cinder-volume-vmware
 install -d -m 755 %{buildroot}%{_sysconfdir}/cinder/volumes
 install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt/conf.d/cinder.conf
 install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/rootwrap.conf
 install -p -D -m 640 etc/cinder/api-paste.ini %{buildroot}%{_sysconfdir}/cinder/api-paste.ini
 install -p -D -m 640 etc/cinder/policy.json %{buildroot}%{_sysconfdir}/cinder/policy.json
 
+%if 0%{?rhel} == 6
 # Install initscripts for services
 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_initrddir}/openstack-cinder-api
 install -p -D -m 755 %{SOURCE11} %{buildroot}%{_initrddir}/openstack-cinder-scheduler
 install -p -D -m 755 %{SOURCE12} %{buildroot}%{_initrddir}/openstack-cinder-volume
 install -p -D -m 755 %{SOURCE13} %{buildroot}%{_initrddir}/openstack-cinder-backup
+%else
+# Install initscripts for services
+install -p -D -m 644 %{SOURCE30} %{buildroot}%{_unitdir}/openstack-cinder-api.service
+install -p -D -m 644 %{SOURCE31} %{buildroot}%{_unitdir}/openstack-cinder-scheduler.service
+install -p -D -m 644 %{SOURCE32} %{buildroot}%{_unitdir}/openstack-cinder-volume.service
+install -p -D -m 644 %{SOURCE33} %{buildroot}%{_unitdir}/openstack-cinder-backup.service
+%endif
 
 # Install sudoers
 install -p -D -m 440 %{SOURCE20} %{buildroot}%{_sysconfdir}/sudoers.d/cinder
@@ -238,25 +264,46 @@ fi
 exit 0
 
 %post
+%if 0%{?rhel} == 6
 for svc in volume api scheduler backup; do
     /sbin/chkconfig --add openstack-cinder-$svc
 done
+%else
+%systemd_post openstack-cinder-volume
+%systemd_post openstack-cinder-api
+%systemd_post openstack-cinder-scheduler
+%systemd_post openstack-cinder-backup
+%endif
 
 %preun
+%if 0%{?rhel} == 6
 if [ $1 -eq 0 ] ; then
     for svc in volume api scheduler backup; do
         /sbin/service openstack-cinder-${svc} stop > /dev/null 2>&1
         /sbin/chkconfig --del openstack-cinder-${svc}
     done
 fi
+%else
+%systemd_preun openstack-cinder-volume
+%systemd_preun openstack-cinder-api
+%systemd_preun openstack-cinder-scheduler
+%systemd_preun openstack-cinder-backup
+%endif
 
 %postun
+%if 0%{?rhel} == 6
 if [ $1 -ge 1 ] ; then
     # Package upgrade, not uninstall
     for svc in volume api scheduler backup; do
         /sbin/service openstack-cinder-${svc} condrestart > /dev/null 2>&1 || :
     done
 fi
+%else
+%systemd_postun_with_restart openstack-cinder-volume
+%systemd_postun_with_restart openstack-cinder-api
+%systemd_postun_with_restart openstack-cinder-scheduler
+%systemd_postun_with_restart openstack-cinder-backup
+%endif
 
 %files
 %doc LICENSE
@@ -276,7 +323,13 @@ fi
 %dir %attr(0755, cinder, root) %{_sysconfdir}/cinder/volumes
 
 %{_bindir}/cinder-*
+
+%if 0%{?rhel} == 6
 %{_initrddir}/openstack-cinder-*
+%else
+%{_unitdir}/*.service
+%endif
+
 %{_datarootdir}/cinder
 %{_mandir}/man1/cinder*.1.gz
 
@@ -295,6 +348,10 @@ fi
 %endif
 
 %changelog
+* Mon Sep 28 2015 Mikhail Ivanov <mivanov@mirantis.com> - 7.0.0.0rc1-1~mos8.0.1
+- Update to a new upstream version
+- Update build and runtime dependencies
+
 * Wed Jun 11 2014 Eric Harney <eharney@redhat.com> - 2014.1.1-2
 - Add dependency on iscsi-initiator-utils
 
diff --git a/rpm/SOURCES/openstack-cinder-volume-vmware.init b/rpm/SOURCES/openstack-cinder-volume-vmware.init
deleted file mode 100644 (file)
index 063ace5..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-#
-# openstack-cinder-volume  OpenStack Cinder Volume Services
-#
-# chkconfig:   - 98 02
-# description:  Volume Workers interact with iSCSI storage to manage    \
-#               LVM-based instance volumes. Specific functions include: \
-#               * Create Volumes                                        \
-#               * Establish Compute volumes
-## BEGIN INIT INFO
-# Provides:
-# Required-Start: $remote_fs $network $syslog
-# Required-Stop: $remote_fs $syslog
-# Default-Stop: 0 1 6
-# Short-Description: OpenStack cinder Volume Worker
-# Description:  Volume Workers interact with iSCSI storage to manage
-#               LVM-based instance volumes. Specific functions include:
-#               * Create Volumes
-#               * Delete Volumes
-#               * Establish Compute volumes
-### END INIT INFO
-
-. /etc/rc.d/init.d/functions
-
-suffix=volume
-cluster=${0##*-} # s/cluster/index/
-prog=openstack-cinder-$suffix-vmware-$cluster
-exec="/usr/bin/cinder-$suffix"
-config="/etc/cinder/cinder.conf"
-pidfile="/var/run/cinder/cinder-$suffix.$cluster.pid"
-logfile="/var/log/cinder/$suffix-$cluster.log"
-
-[ -r /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-lockfile=/var/lock/subsys/$prog
-
-start() {
-    [ -x $exec ] || exit 5
-    [ -f $config ] || exit 6
-    echo -n $"Starting $prog: "
-    daemon --user cinder --pidfile $pidfile "$exec --logfile $logfile ${OPTIONS} &>/dev/null & echo \$! > $pidfile"
-    retval=$?
-    echo
-    [ $retval -eq 0 ] && touch $lockfile
-    return $retval
-}
-
-stop() {
-    echo -n $"Stopping $prog: "
-    killproc -p $pidfile ${prog%%.*}
-    if pgrep -f "cinder-$suffix.*$cluster\.conf" &>/dev/null ; then
-        sleep 2
-        pgrep -f "cinder-$suffix.*$cluster\.conf" &>/dev/null && \
-        pkill -f "$cluster.conf"
-    fi
-    retval=$?
-    echo
-    [ $retval -eq 0 ] && rm -f $lockfile
-    return $retval
-}
-
-restart() {
-    stop
-    start
-}
-
-reload() {
-    restart
-}
-
-force_reload() {
-    restart
-}
-
-rh_status() {
-    status -p $pidfile $prog
-}
-
-rh_status_q() {
-    rh_status >/dev/null 2>&1
-}
-
-
-case "$1" in
-    start)
-        rh_status_q && exit 0
-        $1
-        ;;
-    stop)
-        rh_status_q || exit 0
-        $1
-        ;;
-    restart)
-        $1
-        ;;
-    reload)
-        rh_status_q || exit 7
-        $1
-        ;;
-    force-reload)
-        force_reload
-        ;;
-    status)
-        rh_status
-        ;;
-    condrestart|try-restart)
-        rh_status_q || exit 0
-        restart
-        ;;
-    *)
-        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
-        exit 2
-esac
-exit $?
index 6691d047d14170ad49264022c2024a49d6803b97..2084b49cf11c52f1d2a408eaa842b69a20e59f2c 100755 (executable)
@@ -2,7 +2,31 @@
 echo "Testing $1"
 
 RES=0
+SERVICE="cinder"
 
+function prepare_vm(){
+  if [[ `cat /etc/*-release | head -n 1 | awk '{print $1}'` =~ Ubuntu ]]
+  then
+      echo "mysql-server mysql-server/root_password select $MYSQL_PASSWORD" | sudo debconf-set-selections
+      echo "mysql-server mysql-server/root_password_again select $MYSQL_PASSWORD" | sudo debconf-set-selections
+      apt-get install -y mysql-server python-mysqldb rabbitmq-server curl screen
+  else
+      yum install net-tools mysql-server mysql-wsrep-client-5.6 MySQL-python -y
+
+      # workaround for `sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError)
+      # (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")`
+      rm -f /etc/my.cnf
+      MYSQL_PASSWORD=$(cat /root/.mysql_secret | head -1 | awk -F': ' '{print $2}')
+      service mysql start
+      /usr/bin/mysqladmin -u root -p$MYSQL_PASSWORD password $SERVICE
+  fi
+  mysql -uroot -p$SERVICE <<MYSQL_SCRIPT 
+CREATE DATABASE cinder;
+CREATE USER 'cinder'@'localhost' IDENTIFIED BY 'cinder';
+GRANT ALL PRIVILEGES ON * . * TO 'cinder'@'localhost';
+FLUSH PRIVILEGES;
+MYSQL_SCRIPT
+}
 
 function test_cinder_service(){
   echo "Starting Cinder $1..."
@@ -13,6 +37,7 @@ function test_cinder_service(){
   service_running=`netstat -nat | grep $2 | wc -l`
   if [ $service_running -eq 0 ]; then
     echo "Can not start Cinder $1 service"
+    tail -n 40 /var/log/messages
     RES=1
   else
     echo "Cinder $1 successfully started"
@@ -50,6 +75,7 @@ case $1 in
     done
   ;;
   openstack-cinder)
+    prepare_vm
     test_cinder_configs
 
     count=`ls -1 /usr/bin/cinder* 2>/dev/null | wc -l`