Bug 1089005 - openstack-db fails to update keystone.conf version of sql connection string
Summary: openstack-db fails to update keystone.conf version of sql connection string
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-utils
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 5.0 (RHEL 7)
Assignee: RHOS Maint
QA Contact: Udi Kalifon
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-17 16:06 UTC by Bill Lubanovic
Modified: 2016-12-02 17:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-02 17:48:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1308775 0 None None None Never

Description Bill Lubanovic 2014-04-17 16:06:21 UTC
Description of problem:
When I run "openstack-db --service keystone --init", if the default value of the
connection key in the [sql] section of /etc/keystone/keystone.conf does not contain "mysql:", it prompts to change the default DB to mysql. This fails because of a faulty sed expression.


Version-Release number of selected component (if applicable):
I actually encountered this in Novell's SLES11SP3. It looks like openstack-db and openstack_utils are RedHat-specific, not part of standard OpenStack.


How reproducible:
Consistent.


Steps to Reproduce:
1. Erase the line for "connection" under "[sql]" in /etc/keystone/keystone.conf, or set it to something like "sqlite:///keystone.db".
2. Run "openstack-db --service keystone --init".
3. Answer "y" to prompt to make mysql your default database.
4. /etc/keystone/keystone.conf will not be updated, but no error message appears on stdout, stderr, or any logs.

Actual results:
No change.

Expected results:
In /etc/keystone/keystone.conf:crayadm
[sql]
connection = mysql://keystone:<password>@<host>/keystone

Additional info:
To fix this, correct the "sed" pattern after "-e":

--- From openstack-db: ---
if [ "$MODE" = 'init' ]; then

  # Make sure $APP configuration has the right MySQL password.
  if [ "${MYSQL_APP_PW}" != "${MYSQL_APP_PW_DEFAULT}" ]; then
    echo "Updating '$APP' database password in ${APP_CONFIG}"
    sed -i -e "s|^#* *\(\(sql_\)*connection *= *mysql://$APP\):.*@|\1:${MYSQL_APP_PW}@|" ${APP_CONFIG}
  fi
---

Comment 2 Alan Pevec 2016-12-02 17:48:14 UTC
openstack-db was removed upstream https://github.com/redhat-openstack/openstack-utils/issues/19


Note You need to log in before you can comment on or make changes to this bug.