Commit Graph

22 Commits

Author SHA1 Message Date
Dr. Jens Harbott 353c3f9cb1
Fix stacking without preconfigured DATABASE_PASSWORD
When we need to read a DATABASE_PASSWORD from the user, make sure we
actually use it in our database URLs.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I5ebf6b0280e82f2c87a63cbee7a9957c6bd26898
2021-12-23 12:07:29 +01:00
Luigi Toscano 29771c1c1e Remove the usage of read_password from library files
The read_password function is defined inside stack.sh
and it cannot be used inside the "public library interface"
provided by DevStack.

Move the calls found inside library files to stack.sh,
following the same pattern of the other calls to read_password.

Change-Id: I8adc6723b677dfac2bef735f660e056c498bf773
2019-02-21 10:37:45 +01:00
Ian Wienand 523f488036 Namespace XTRACE commands
I noticed this when debugging some grenade issues failures.

An include of grenade/functions stores the current value of XTRACE
(on) and disables xtrace for the rest of the import.

We then include devstack's "functions" library, which now overwrites
the stored value of XTRACE the current state; i.e. disabled.

When it finishes it restores the prior state (disabled), and then
grenade restores the same value of XTRACE (disabled).

The result is that xtrace is incorrectly disabled until the next time
it just happens to be turned on.

The solution is to name-space the store of the current-value of xtrace
so when we finish sourcing a file, we always restore the tracing value
to what it was when we entered.

Some files had already discovered this.  In general there is
inconsistency around the setting of the variable, and a lot of obvious
copy-paste.  This brings consistency across all files by using
_XTRACE_* prefixes for the sotre/restore of tracing values.

Change-Id: Iba7739eada5711d9c269cb4127fa712e9f961695
2015-11-27 15:36:04 +11:00
Julien Danjou 0eec4f86c1 database: fix PostgreSQL connection string
If all databases drivers are loaded, MySQL SQLAlchemy driver
overrides all the other one that might not have set one.
This patches fixes that.

Change-Id: If6d8d08e5b7b7c48ca012677b536d71058def6fd
Closes-Bug: #1493304
2015-09-08 16:15:33 +00:00
Brian Haley 180f5eb652 Add IPv6 support to devstack infrastructure
By default, most Openstack services are bound to 0.0.0.0
and service endpoints are registered as IPv4 addresses.
With this change we introduce two new variables to control
this behavior:

SERVICE_IP_VERSION - can either be "4" or "6".

When set to "4" (default if not set) devstack will operate
as today - most services will open listen sockets on 0.0.0.0
and service endpoints will be registered using HOST_IP as the
address.

When set to "6" devstack services will open listen sockets on ::
and service endpoints will be registered using HOST_IPV6 as the
address.

There is no support for "4+6", more work is required for that.

HOST_IPV6 - if SERVICE_IP_VERSION=6 this must be an IPv6
address configured on the system.

Some existing services, like the Openvswitch agent, will continue
to use IPv4 addresses for things like tunnel endpoints.  This is
a current restriction in the code and can be updated at a later
time.  This change is just a first step to supporting IPv6-only
control and data planes in devstack.

This change is also partly based on two previous patches,
https://review.openstack.org/#/c/140519/ and
https://review.openstack.org/#/c/176898/

Change-Id: I5c0b775490ce54ab104fd5e89b20fb700212ae74
Co-Authored-By: Sean Collins <sean@coreitpro.com>
Co-Authored-By: Baodong Li <baoli@cisco.com>
Co-Authored-By: Sridhar Gaddam <sridhar.gaddam@enovance.com>
Co-Authored-By: Adam Kacmarsky <adam.kacmarsky@hp.com>
Co-Authored-By: Jeremy Alvis <jeremy.alvis@hp.com>
2015-07-02 15:16:34 -06:00
Dean Troyer 5686dbc45d Add global venv enable/disable knob
Adds USE_VENV to globally enable/disable use of virtual environments.

ADDITIONAL_VENV_PACKAGES is used to manually add packages that do not
appear in requirements.txt or test-requirements.txt to be installed
into each venv.  Database Python bindings are handled this way when
a dataabse service is enabled.

Change-Id: I9cf298b936fd10c95e2ce5f51aab0d49d4b7f37f
2015-03-20 09:48:43 -05:00
Jenkins 955f80a7ef Merge "Enforce UTF-8 encoding when creating databases" 2015-01-20 15:44:07 +00:00
Sean Dague 537532931d Make changes such that -o nounset runs
This makes a bunch of variable cleanups that will let -o nounset
function, for the time being we hide nounset behind another setting
variable so that it's not on by default.

Because this is bash, and things are only executed on demand, this
probably only works in the config it was run in. Expect cleaning up
all the paths to be something that takes quite a while.

This also includes a new set of unit tests around the trueorfalse
function, because my change in how it worked, didn't. Tests are good
m'kay.

Change-Id: I71a896623ea9e1f042a73dc0678ce85acf0dc87d
2015-01-15 13:06:14 -05:00
Ihar Hrachyshka 157c84b876 Enforce UTF-8 encoding when creating databases
We use InnoDB everywhere, so there should be no issues with long unicode
keys. Dropped charset parameter for recreate_database since it's not
needed anymore.

Change-Id: Ib768402a9337c918309030a92ab81da17269f4f6
2015-01-05 15:57:23 +01:00
Sean Dague e263c82e48 add shebang lines to all lib files
With gerrit 2.8, and the new change screen, this will trigger syntax
highlighting in gerrit. Thus making reviewing code a lot nicer.

Change-Id: Id238748417ffab53e02d59413dba66f61e724383
2014-12-10 11:28:05 -05:00
ihrachyshka cbea3447c7 Add ability to switch database driver
Also added mysqlconnector packages into default installation.

blueprint enable-mysql-connector

Change-Id: Ib2cda7cb183dc8f0ff4759cc6e9ecab469fd121c
2014-08-15 15:47:22 +02:00
Adam Spiers 6a5aa7c6a2 Fix some Markdown formatting issues
Address miscellaneous issues with Markdown formatting in comments which
are consumed by shocco when generating the online documentation.

Change-Id: I953075cdbddbf1f119c6c7e35f039e2e54b79078
2013-10-24 17:38:19 +01:00
Adam Spiers cb961597cc Fix shocco errors and warnings
A few Markdown-oriented issues were causing Docutils errors to
leak into the end-user docs on http://devstack.org

Change-Id: I51fa9698afb1bfb48596478d83bd1fdcd84ac52e
2013-10-24 15:43:05 +01:00
Matt Riedemann 96ba6ec1bf Change DATABASE_HOST default to 127.0.0.1
Attempt to fix what is suspected to be a DNS resolution issue with
postgresql check job.

Closes-Bug: #1232748

Change-Id: Ic82e54b2af038e6c21d4f026f3da10f34c3c185c
2013-10-02 11:08:56 -07:00
Tal Kain 0729d06fae lib/database: Fixed a bug in database_connection_url
The changes from https://review.openstack.org/#/c/23364/ simplified
the usage of database_connection_url_mysql and
database_connection_url_postgresql without making the proper changes
to database_connection_url.

Fixes: bug #1167668
Signed-off-by: Tal Kain <tal.kain@ravellosystems.com>
Change-Id: I5115d123ad794f2eb2e144b76932031af5248f26
2013-04-29 23:08:27 +03:00
Dean Troyer cc6b443545 Formatting cleanups, doc updates and whatnot
Change-Id: Ica8298353be22f947c8e8a03d8dc29ded9cb26dd
2013-04-09 14:05:32 -05:00
Sean Dague 584d90ec56 add emacs shell-script tagging
for files that don't start with a #! or end in .sh, the added tags
are nice for emacs users to automatically switch to the right mode.

Change-Id: If4b93e106191bc744ccad8420cef20e751cdf902
2013-03-29 14:36:49 -04:00
Dean Troyer 995eb927f7 Add clean.sh
clean.sh gets rid of all residue of running DevStack except installed
packages and pip modules.

And it eradicates rabbitmq-server and ts erlang dependencies as well as
the other RPC backends and databases.

Change-Id: I2b9a251a0a151c012bae85a5a2f9c2f72e7700be
2013-03-15 10:30:37 -05:00
Bob Ball 3aa8887170 Allow DATABASE_TYPE to be specified in localrc
The use of DATABASE_TYPE without forcing it into ENABLED_SERVICES
seems to be the only way to set up a multi-host devstack installation.

Only deprecate use_database.
Changes functionality of use_database to be equivalent to specifying DATABASE_TYPE
This means that people with localrc's that only specify use_database used to have
a database service brought up, but now will not until they add it to ENABLED_SERVICES.

Change-Id: I4c6e8ee31f298004338ca46bfc330a3e3af288aa
Fixes: bug 1136028
2013-03-01 14:04:13 +00:00
Dean Troyer afc29fe5f2 Deprecate DATABASE_TYPE and use_database
Select a database by adding it to ENABLED_SERVICE like the other
services.  This greatly simplifies using the lib/* functions in
places other than stack.sh

Backward-compatibility is maintained or now (into havana at least).

Change-Id: I967e44603b4d69d5d70e1a75a9938172ca434025
2013-02-21 17:32:04 -06:00
Dean Troyer c1b486a520 Simplify database selection
Do not require every script that sources stackrc to also
source lib/databases.

* Move use_databases() to functions
* Set DATABASE_TYPE in stackrc
* Allow setting DATABASE_TYPE in localrc to work
  (use_database() essentially just sets DATABASE_TYPE at this stage
  so continuing to use it is equivalent)
* Validate DATABASE_TYPE in stack.sh.
* Change sudo to postgresql user to go through root to eliminate
  password prompt
* fix use_database error condition

Change-Id: Ibb080c76e6cd7c6eebbb641a894d54b1dde78ca6
2012-11-15 11:48:18 -05:00
Terry Wilson 428af5a257 Add PostgreSQL support to devstack
This patch adds an interface for supporting multiple database backend
types and implemnts support for PostgreSQL. It also adds a function,
use_exclusive_service, which serves as a base for enabling a service
that conflicts with other services. The use_database function uses it,
and it might also be useful for selecting messaging backends.

MySQL is still selected by default. Tested on Fedora 17 and Ubuntu
12.04 with MySQL and PostgreSQL. Implements blueprint postgresql-support

Change-Id: I4b1373e25676fd9a9809fe70cb4a6450a2479174
2012-11-03 18:19:21 -04:00