Skip to content

Commit

Permalink
Don't run ceilometer-upgrade on unconfigured db
Browse files Browse the repository at this point in the history
When the database backend is unconfigured, we currently
try to connection to nothing, and due to the retry logic around
the database connection, the user experience is "ceilometer-upgrade is
stuck".

This change keeps the database upgrade is the database is not
configured. And don't use the connection retry logic for upgrade.

Change-Id: I3fa2a332ecac6cb52c145f437f79b2aba43a4757
  • Loading branch information
Mehdi Abaakouk committed Mar 4, 2017
1 parent d6506b6 commit 7905ff3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ceilometer/cmd/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ def upgrade():
if conf.skip_metering_database:
LOG.info("Skipping metering database upgrade")
else:
LOG.debug("Upgrading metering database")
storage.get_connection_from_config(conf).upgrade()

url = (getattr(conf.database, 'metering_connection') or
conf.database.connection)
if url:
LOG.debug("Upgrading metering database")
storage.get_connection(conf, url).upgrade()
else:
LOG.info("Skipping metering database upgrade, "
"legacy database backend not configured.")

if conf.skip_gnocchi_resource_types:
LOG.info("Skipping Gnocchi resource types upgrade")
Expand Down
3 changes: 3 additions & 0 deletions devstack/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ function _ceilometer_configure_cache_backend {

# Set configuration for storage backend.
function _ceilometer_configure_storage_backend {

inidelete $CEILOMETER_CONF database metering_connection

if [ "$CEILOMETER_BACKEND" = 'none' ] ; then
# It's ok for the backend to be 'none', if panko is enabled. We do not
# combine this condition with the outer if statement, so that the else
Expand Down

0 comments on commit 7905ff3

Please sign in to comment.