Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 851143 Details for
Bug 1045034
Review Request: openstack-neutron - check whether db needs to be upgraded
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for f20 branch
0001-check-whether-db-needs-to-be-upgraded-f20.patch (text/plain), 6.18 KB, created by
Jakub Libosvar
on 2014-01-16 15:13:52 UTC
(
hide
)
Description:
Patch for f20 branch
Filename:
MIME Type:
Creator:
Jakub Libosvar
Created:
2014-01-16 15:13:52 UTC
Size:
6.18 KB
patch
obsolete
>From e0097335f21fcd7489c4e763f6c99bb5c4556db9 Mon Sep 17 00:00:00 2001 >From: Jakub Libosvar <jlibosva@redhat.com> >Date: Wed, 11 Dec 2013 11:26:30 +0100 >Subject: [PATCH] check whether db needs to be upgraded > >If neutron is upgraded from previous release (Grizzly) there >needs to be run db upgrade before services are started. Starting >services without upgrading db may lead into inconsistent behavior. >Neutron service will not start if db is still from previous release >while packages are from current release. > >Resolves: rhbz#1031801 >--- > neutron-db-check | 41 +++++++++++++++++++++++++++++++++++++++++ > neutron-server.service | 1 + > openstack-neutron.spec | 25 +++++++++++++++++++++---- > openstack-neutron.sysconfig | 1 + > 4 files changed, 64 insertions(+), 4 deletions(-) > create mode 100755 neutron-db-check > create mode 100644 openstack-neutron.sysconfig > >diff --git a/neutron-db-check b/neutron-db-check >new file mode 100755 >index 0000000..19b8707 >--- /dev/null >+++ b/neutron-db-check >@@ -0,0 +1,41 @@ >+#!/bin/sh >+# >+# This script checks to make sure the database used by Neutron is at the >+# correct version. If the database is not at $NEUTRON_EXPECTED_DB_VERSION, as >+# set in /etc/sysconfig/openstack-neutron, log an error and exit with an error >+# code. >+# >+# This script is meant to be called from an init script or via ExecPreStart in >+# a systemd unit. >+ >+RETCODE=0 >+ >+[ -f /etc/sysconfig/openstack-neutron ] && . /etc/sysconfig/openstack-neutron >+ >+[ "$NEUTRON_EXPECTED_DB_VERSION" ] || exit 0 >+ >+neutron_db_version=$( >+ neutron-db-manage \ >+ --config-file /etc/neutron/neutron.conf \ >+ --config-file /etc/neutron/plugin.ini current 2>/dev/null | >+ awk '{print $NF}') >+ >+if [ "x$neutron_db_version" = "x" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: unable to find version information for the neutron database."\ >+ "Check your logs for additional information." >+ RETCODE=1 >+elif [ "x$neutron_db_version" = "xNone" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: neutron database does not have version information."\ >+ "You must run the \"neutron-db-manage stamp\" command before"\ >+ "starting neutron services." >+ RETCODE=1 >+elif [ "x$neutron_db_version" != "x$NEUTRON_EXPECTED_DB_VERSION" ]; then >+ logger -s -p daemon.error -t neutron-db-check \ >+ "ERROR: you must upgrade the neutron database before starting"\ >+ "neutron services." >+ RETCODE=1 >+fi >+ >+exit $RETCODE >diff --git a/neutron-server.service b/neutron-server.service >index 20feb40..25339e4 100644 >--- a/neutron-server.service >+++ b/neutron-server.service >@@ -7,6 +7,7 @@ Type=simple > User=neutron > ExecStart=/usr/bin/neutron-server --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini --log-file /var/log/neutron/server.log > PrivateTmp=true >+ExecStartPre=/usr/bin/neutron-db-check > > [Install] > WantedBy=multi-user.target >diff --git a/openstack-neutron.spec b/openstack-neutron.spec >index 2ef9d7c..9fcda24 100644 >--- a/openstack-neutron.spec >+++ b/openstack-neutron.spec >@@ -2,7 +2,7 @@ > > Name: openstack-neutron > Version: 2013.2.1 >-Release: 2%{?dist} >+Release: 3%{?dist} > Provides: openstack-quantum = %{version}-%{release} > Obsoletes: openstack-quantum < 2013.2-0.4.b3 > Summary: OpenStack Networking Service >@@ -33,6 +33,9 @@ Source21: neutron-vpn-agent.service > Source22: neutron-metering-agent.service > > Source30: neutron-dist.conf >+ >+Source40: neutron-db-check >+Source41: openstack-neutron.sysconfig > # > # patches_base=2013.2.1+1 > # >@@ -473,6 +476,12 @@ install -p -D -m 755 %{SOURCE7} %{buildroot}%{_bindir}/neutron-l3-setup > # Install dist conf > install -p -D -m 640 %{SOURCE30} %{buildroot}%{_datadir}/neutron/neutron-dist.conf > >+# Install neutron-db-check >+install -m 755 %{SOURCE40} %{buildroot}%{_bindir}/neutron-db-check >+install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig >+install -m 644 %{SOURCE41} %{buildroot}%{_sysconfdir}/sysconfig/openstack-neutron >+ >+ > # Install version info file > cat > %{buildroot}%{_sysconfdir}/neutron/release <<EOF > [Neutron] >@@ -553,8 +562,10 @@ if [ -e %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM ];then > ln -s ${plugin_ini//quantum/neutron} %{_sysconfdir}/neutron/plugin.ini > fi > >- # Stamp the existing db as grizzly to avoid neutron-server breaking db migration >- neutron-db-manage --config-file %{_sysconfdir}/neutron/neutron.conf --config-file %{_sysconfdir}/neutron/plugin.ini stamp grizzly || : >+ # Stamp the existing db as grizzly to avoid neutron-server breaking db >+ # migration after upgrade >+ neutron-db-manage --config-file %{_sysconfdir}/neutron/neutron.conf \ >+ --config-file %{_sysconfdir}/neutron/plugin.ini stamp grizzly || : > > # Restore the enablement of the various neutron services > source %{_localstatedir}/lib/rpm-state/UPGRADE_FROM_QUANTUM >@@ -707,6 +718,8 @@ fi > %{_bindir}/neutron-server-setup > %{_bindir}/neutron-usage-audit > >+%{_bindir}/neutron-db-check >+ > %{_unitdir}/neutron-dhcp-agent.service > %{_unitdir}/neutron-l3-agent.service > %{_unitdir}/neutron-lbaas-agent.service >@@ -724,6 +737,7 @@ fi > %config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/policy.json > %config(noreplace) %attr(0640, root, neutron) %{_sysconfdir}/neutron/neutron.conf > %config(noreplace) %{_sysconfdir}/neutron/rootwrap.conf >+%config %{_sysconfdir}/sysconfig/openstack-neutron > %dir %{_sysconfdir}/neutron/plugins > %config(noreplace) %{_sysconfdir}/logrotate.d/* > %config(noreplace) %{_sysconfdir}/sudoers.d/neutron >@@ -913,7 +927,10 @@ fi > > > %changelog >-* Tue Jan 07 2014 Terry Wilson <twilson@redhat.com> - 2013.2.1-1 >+* Thu Jan 16 2014 Jakub Libosvar <jlibosva@redhat.com> - 2013.2.1-3 >+- Check whether db needs to be upgraded (rhbz#1031801) >+ >+* Tue Jan 07 2014 Terry Wilson <twilson@redhat.com> - 2013.2.1-2 > - Add python-psutil requirement for openvswitch agent, bz#1049235 > > * Wed Dec 18 2013 Pádraig Brady <pbrady@redhat.com> - 2013.2.1-1 >diff --git a/openstack-neutron.sysconfig b/openstack-neutron.sysconfig >new file mode 100644 >index 0000000..8394337 >--- /dev/null >+++ b/openstack-neutron.sysconfig >@@ -0,0 +1 @@ >+NEUTRON_EXPECTED_DB_VERSION=havana >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1045034
:
851141
|
851142
| 851143