From aed008cb59e23674e086ed32aae99c47e6eeecb3 Mon Sep 17 00:00:00 2001 From: Mikhail Ivanov Date: Mon, 28 Sep 2015 15:39:01 +0300 Subject: [PATCH] Rebuild cinder for liberty - Update to a new upstream version - Update build and runtime dependencies Change-Id: I2034c026679da2323844408a2889062c0de6b8aa --- ...ntime-dep-on-python-pbr-python-d2to1.patch | 0 {rpm => centos7/rpm}/SOURCES/cinder-dist.conf | 0 {rpm => centos7/rpm}/SOURCES/cinder-sudoers | 0 {rpm => centos7/rpm}/SOURCES/cinder-tgt.conf | 0 .../rpm}/SOURCES/cinder.conf.sample | 0 {rpm => centos7/rpm}/SOURCES/cinder.logrotate | 0 .../rpm}/SOURCES/openstack-cinder-api.init | 0 .../rpm/SOURCES/openstack-cinder-api.service | 11 ++ .../rpm}/SOURCES/openstack-cinder-backup.init | 0 .../SOURCES/openstack-cinder-backup.service | 12 ++ .../SOURCES/openstack-cinder-scheduler.init | 0 .../openstack-cinder-scheduler.service | 12 ++ .../rpm}/SOURCES/openstack-cinder-volume.init | 0 .../SOURCES/openstack-cinder-volume.service | 11 ++ .../rpm}/SPECS/openstack-cinder.spec | 135 +++++++++++++----- tests/runtests.sh | 26 ++++ 16 files changed, 169 insertions(+), 38 deletions(-) rename {rpm => centos7/rpm}/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch (100%) rename {rpm => centos7/rpm}/SOURCES/cinder-dist.conf (100%) rename {rpm => centos7/rpm}/SOURCES/cinder-sudoers (100%) rename {rpm => centos7/rpm}/SOURCES/cinder-tgt.conf (100%) rename {rpm => centos7/rpm}/SOURCES/cinder.conf.sample (100%) rename {rpm => centos7/rpm}/SOURCES/cinder.logrotate (100%) rename {rpm => centos7/rpm}/SOURCES/openstack-cinder-api.init (100%) create mode 100644 centos7/rpm/SOURCES/openstack-cinder-api.service rename {rpm => centos7/rpm}/SOURCES/openstack-cinder-backup.init (100%) create mode 100644 centos7/rpm/SOURCES/openstack-cinder-backup.service rename {rpm => centos7/rpm}/SOURCES/openstack-cinder-scheduler.init (100%) create mode 100644 centos7/rpm/SOURCES/openstack-cinder-scheduler.service rename {rpm => centos7/rpm}/SOURCES/openstack-cinder-volume.init (100%) create mode 100644 centos7/rpm/SOURCES/openstack-cinder-volume.service rename {rpm => centos7/rpm}/SPECS/openstack-cinder.spec (79%) diff --git a/rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch b/centos7/rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch similarity index 100% rename from rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch rename to centos7/rpm/SOURCES/0001-Remove-runtime-dep-on-python-pbr-python-d2to1.patch diff --git a/rpm/SOURCES/cinder-dist.conf b/centos7/rpm/SOURCES/cinder-dist.conf similarity index 100% rename from rpm/SOURCES/cinder-dist.conf rename to centos7/rpm/SOURCES/cinder-dist.conf diff --git a/rpm/SOURCES/cinder-sudoers b/centos7/rpm/SOURCES/cinder-sudoers similarity index 100% rename from rpm/SOURCES/cinder-sudoers rename to centos7/rpm/SOURCES/cinder-sudoers diff --git a/rpm/SOURCES/cinder-tgt.conf b/centos7/rpm/SOURCES/cinder-tgt.conf similarity index 100% rename from rpm/SOURCES/cinder-tgt.conf rename to centos7/rpm/SOURCES/cinder-tgt.conf diff --git a/rpm/SOURCES/cinder.conf.sample b/centos7/rpm/SOURCES/cinder.conf.sample similarity index 100% rename from rpm/SOURCES/cinder.conf.sample rename to centos7/rpm/SOURCES/cinder.conf.sample diff --git a/rpm/SOURCES/cinder.logrotate b/centos7/rpm/SOURCES/cinder.logrotate similarity index 100% rename from rpm/SOURCES/cinder.logrotate rename to centos7/rpm/SOURCES/cinder.logrotate diff --git a/rpm/SOURCES/openstack-cinder-api.init b/centos7/rpm/SOURCES/openstack-cinder-api.init similarity index 100% rename from rpm/SOURCES/openstack-cinder-api.init rename to centos7/rpm/SOURCES/openstack-cinder-api.init diff --git a/centos7/rpm/SOURCES/openstack-cinder-api.service b/centos7/rpm/SOURCES/openstack-cinder-api.service new file mode 100644 index 000000000..4d7b4b3a0 --- /dev/null +++ b/centos7/rpm/SOURCES/openstack-cinder-api.service @@ -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/rpm/SOURCES/openstack-cinder-backup.init b/centos7/rpm/SOURCES/openstack-cinder-backup.init similarity index 100% rename from rpm/SOURCES/openstack-cinder-backup.init rename to centos7/rpm/SOURCES/openstack-cinder-backup.init diff --git a/centos7/rpm/SOURCES/openstack-cinder-backup.service b/centos7/rpm/SOURCES/openstack-cinder-backup.service new file mode 100644 index 000000000..e1b2548d1 --- /dev/null +++ b/centos7/rpm/SOURCES/openstack-cinder-backup.service @@ -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/rpm/SOURCES/openstack-cinder-scheduler.init b/centos7/rpm/SOURCES/openstack-cinder-scheduler.init similarity index 100% rename from rpm/SOURCES/openstack-cinder-scheduler.init rename to centos7/rpm/SOURCES/openstack-cinder-scheduler.init diff --git a/centos7/rpm/SOURCES/openstack-cinder-scheduler.service b/centos7/rpm/SOURCES/openstack-cinder-scheduler.service new file mode 100644 index 000000000..e79166251 --- /dev/null +++ b/centos7/rpm/SOURCES/openstack-cinder-scheduler.service @@ -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/rpm/SOURCES/openstack-cinder-volume.init b/centos7/rpm/SOURCES/openstack-cinder-volume.init similarity index 100% rename from rpm/SOURCES/openstack-cinder-volume.init rename to centos7/rpm/SOURCES/openstack-cinder-volume.init diff --git a/centos7/rpm/SOURCES/openstack-cinder-volume.service b/centos7/rpm/SOURCES/openstack-cinder-volume.service new file mode 100644 index 000000000..d274baee8 --- /dev/null +++ b/centos7/rpm/SOURCES/openstack-cinder-volume.service @@ -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 diff --git a/rpm/SPECS/openstack-cinder.spec b/centos7/rpm/SPECS/openstack-cinder.spec similarity index 79% rename from rpm/SPECS/openstack-cinder.spec rename to centos7/rpm/SPECS/openstack-cinder.spec index 8c7968d26..0e72d89d1 100644 --- a/rpm/SPECS/openstack-cinder.spec +++ b/centos7/rpm/SPECS/openstack-cinder.spec @@ -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 @@ -19,6 +20,11 @@ Source12: openstack-cinder-volume.init Source13: openstack-cinder-backup.init Source14: cinder.conf.sample +Source30: openstack-cinder-api.service +Source31: openstack-cinder-scheduler.service +Source32: openstack-cinder-volume.service +Source33: openstack-cinder-backup.service + Source20: cinder-sudoers @@ -35,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 @@ -48,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 @@ -66,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 @@ -123,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 @@ -203,11 +223,19 @@ install -p -D -m 640 etc/cinder/rootwrap.conf %{buildroot}%{_sysconfdir}/cinder/ 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 @@ -236,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 @@ -274,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 @@ -293,6 +348,10 @@ fi %endif %changelog +* Mon Sep 28 2015 Mikhail Ivanov - 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 - 2014.1.1-2 - Add dependency on iscsi-initiator-utils diff --git a/tests/runtests.sh b/tests/runtests.sh index 6691d047d..2084b49cf 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -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 </dev/null | wc -l` -- 2.45.2