42 Commits

Author SHA1 Message Date
Wiekus Beukes
ec47bc1d72 Add support for Oracle Linux 7 and later.
Most of the changes revolves around using MySQL rather than MariaDB,
plus enabling the addon repos on public-yum.oracle.com.
The patch just touch the areas where there is a divergence between the
Fedora and Oracle distributions and in all other cases the is_fedora
will result in the correct decision to be made and left as is.

Collapsed the is_suse and is_oraclelinux into a single check in
configure_database_mysql and cleanup_database_mysql

Added Oracle Linux to MAINTAINERS.rst

Rather than duplicating most of the Redhat version check code, added
a check in the block to do the determination if it is Oracle Linux

Change-Id: I5f1f15106329eec67aa008b17847fa44863f243f
2015-03-22 21:28:35 -07:00
Dean Troyer
b1d8e8e274 Build wheel cache for venvs
Building a bunch of virtual envs later is going to be tedious if we do not
pre-cache certain annoying-to-build packages.

* tools/build_wheels.sh: pre-build some wheels for annoying package installs
* list distro package dependencies in files/*/venv
* list packages to pre-build as wheels in files/venv-requirements.txt
* install database Python modules when setting up the database

Change-Id: Idff1ea69a5ca12ba56098e664dbf6924fe6a2e47
2015-02-18 15:13:00 -06:00
Sean Dague
9a413abcd4 add gating up/down script for devstack
This adds the test infrastructure for testing that unstack.sh and
clean.sh do the right thing, and actually stop what's expected. This
is designed to be used in upstream testing to make unstack and clean a
bit more certain.

It includes numerous fixes to make these pass in an errexit
environment with the gate config. The scripts still don't run under
errexit because we don't assume we've handled all possible cleanup safely.

Change-Id: I774dfb2cc934367eef2bb7ea5123197f6da7565b
2015-02-11 06:10:38 -05:00
Attila Fazekas
1f316beb20 Remove rhel6 and py26 support
el6 is shipped with Python 2.6.x which is not expected
to be supported with the openstack kilo release.

For el6 support we need to do lot of thing differently,
which makes the code more complicated.

This change removes el6 and py26 support from devstack.

This change also removed a discontinued (1 year ago)
openSUSE 12.2 code path, which used a similar codepath as el6.

Several comment related to el6 also removed or modified.

Change-Id: Iea0b0c98a5e11fd85bb5e93c099f740fe05d2f3a
2015-01-27 09:22:52 +01:00
Jenkins
955f80a7ef Merge "Enforce UTF-8 encoding when creating databases" 2015-01-20 15:44:07 +00:00
Bob Ball
9033343733 Set password irrespective of mysql server version
Ubuntu recently upgraded from 5.1 to 5.5 so the previous debconf
settings no longer work.  Removing the version number should make
the settings work for all versions of mysql

Change-Id: I6b399a06232364d3ba3bf74430b663e0b8b922ed
2015-01-19 13:20:44 +00:00
Jenkins
62002dd88b Merge "clean mysql better" 2015-01-17 22:47:58 +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
Sean Dague
8f90f765fa clean mysql better
The purge that was previously removed was actually kind of important
to burning mysql back down to a stateless zero point. Bring this back
with the addition of doing it for mariadb as well.

Change-Id: If608db8731d9ddfb2440a37387409798619b163c
2015-01-14 12:25:14 -05:00
Moshe Levi
d97d2cb017 fix mysql clean on ubuntu
Closes-Bug: 1409902
Change-Id: I72900eb2c7f3c6f66d829b10e9bb73b6d186da98
2015-01-13 15:02:19 +02: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
1cbb5d3f0c Clean database ubuntu/RHEL/SUSE use uninstall_package and clean /var/lib/mysql
Change-Id: I72c9df06903e536320a807fae8b817379e448444
Related-Bug: #1395776
2014-12-15 10:19:42 -05: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
pcrews
6de7dba863 Return mysql-server to default for all ubuntu installs
Change: I97cbede806e5c00363c7174fa1e9f286de96aab6 altered
the logic in lib/databases/mysql from installing mariadb only if
one was using rhel7 to installing it by default unless one was using
rhel6.

Change: Iae9a7a1c09f1fc83573c3926b3470955c244c401
Attempted to fix this, but only does so for precise.

Unless mariadb has become the default, I strongly prefer to keep
standard mysql as the database on ubuntu (precise or otherwise).

Closes-Bug: 1395776

Change-Id: I3afb89ae6d55405313b7219dd6daa24d9ca80f70
2014-11-24 08:04:39 -08:00
Akihiro Motoki
8f003ef9bf Use mysql in Ubuntu 12.04 (precise)
After commit 6d20f090, devstack does not work on Ubuntu 12.04
because Ubuntu 12.04 does not provide mariadb but devstack expects it.

Change-Id: Iae9a7a1c09f1fc83573c3926b3470955c244c401
2014-11-18 13:41:58 +09:00
Pavel Sedlák
6d20f09045 Initial support for Fedora 21
Initial support for Fedora 21.  Add f21 to the distribution lists for
rpms, ensure "mariadb" is used over "mysqld" and enable it in the
distro check, as we have several reports of it working.

Tested with [1]

[1] http://download.fedoraproject.org/pub/fedora/linux/releases/test/21-Beta/Cloud/Images/x86_64/Fedora-Cloud-Base-20141029-21_Beta.x86_64.qcow2

Change-Id: I97cbede806e5c00363c7174fa1e9f286de96aab6
2014-11-12 17:46:40 +01:00
Dean Troyer
3ef23bceec Clean up local variable usage - Backends
Combines cleanup for mysql, postgresql and rpc

Change-Id: I37b928a669146671c946fc1ccb8e3ef1a27a3891
2014-07-25 16:24:00 -05:00
Sean Dague
e56c137edb make mysql run in strict mode
this might obviate the need for postgresql in the gate, as it will
make mysql act more strict. Suggested by Monty during Atlanta
summit on test matrix.

Change-Id: Ibfcb0959159f3b84fe35a1198d481bff308da0d4
2014-06-03 05:57:30 -04:00
Attila Fazekas
3b53aebabd Fedora mysql log dir is /var/log/mariadb
/var/log/mysql does not exists on f20, f19, rhel7 by default,
but the /var/log/mariadb exists.

Change-Id: I0def3eaead491a00e6f8467db6b31502b9376188
2014-04-30 11:57:22 +02:00
Ralf Haferkamp
0526bb8222 Use iniset for changing my.conf and avoid deprecated config options
The mysql config file is using INI format so use the iniset function to
manipulate it. This change also rearranges the config updates a bit
allowing us to make mulitple changes in a single sudo call. This reduces
the number of required process forks, and the number of times the 'functions'
file needs to be sourced a bit.

The "log-slow-queries" option is deprecated since mysql 5.1.29 and got
removed with 5.6.x. Use the newer slow-query-log-file/slow-query-log
settings instead. They are available since 5.1.12. This fixes a problem
with running devstack with mysql-5.6, which is e.g. part of openSUSE
13.1.

Change-Id: Iea28bf05c664b5387d51dae1a63a780344623596
2014-04-10 14:03:14 +02:00
Tiago Mello
4376ae04df Clean /etc/mysql when calling clean.sh
The clean.sh script should also remove the /etc/mysql
directory. It contains information from the old
devstack installation and may conflict with the further
one. apt-get purge does not remove it since the
directory is not empty.

Change-Id: I885345a2311851d8746abe42e44300ecd4f6e08a
2014-03-14 10:58:02 -03:00
Jenkins
ebd1321fcb Merge "Removes the dependence with aptitude" 2014-02-26 12:47:39 +00:00
Sahid Orentino Ferdjaoui
e9648276a6 Removes the dependence with aptitude
Removes the dependence with aptitude by replacing
the call of:
  aptitude purge -y ~npackage by apt_get purge -y package*

Change-Id: I08875ffad9dc6293047827666f02453a355b16ea
Closes-Bug: 1281410
2014-02-24 09:41:07 +01:00
Attila Fazekas
2d65059e72 Add RHEL7 beta support
RHEL7 still in beta status, so it will require the FORCE option,
until the GA release.

The main notable difference from another RHEL family members, it does
not have the mysql alias for the mariadb.

Change-Id: Ic90bb6c3dd9447fc80453c3dc1adb22cdfc6226f
2014-02-20 17:02:51 +01:00
Jeremy Stanley
c4f47345a5 Make MySQL query logging optional
* lib/databases/mysql: Wrap query log configuration in a check for a
ENABLE_QUERY_LOGGING variable.

* stackrc: Add the DATABASE_QUERY_LOGGING variable defaulted to True.

Change-Id: Iddf8538ad0a1e36e2c6944dc70315984026c8245
2014-01-31 20:39:10 +00: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
Jenkins
7ad51b4a47 Merge "Do not install mysql if mariadb is installed on openSUSE" 2013-07-16 20:01:32 +00:00
zhhuabj
2832f28012 Set MYSQL_HOST parameter to better support multi-node mode.
When deploying openstack with multi-node mode,
mysql needs to be started by listening it's real ip, not localhost.
but devstack always use localhost to recreate databases that will
lead bellow errors.

Fix bug 1177735

Change-Id: I50284f469a998d023a41b4796f1dc775bb52e710
2013-05-08 18:47:49 +08:00
Vincent Untz
623a0a58f6 Do not install mysql if mariadb is installed on openSUSE
mariadb and mysql are conflicting on a package level, but are compatible
for our needs. So if mariadb is already installed, do not try to install
mysql.

Change-Id: I3aa991c1c4691df3e3f4798505668da3ab908998
2013-04-11 08:41:27 +02: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
Attila Fazekas
7e79d9139f Simplify database_connection_url
* does not expects dynamic scoping.
* does not uses eval.

Change-Id: I5ba4e5b7ffaabbb3c2bddadf9e53a2875de8b7c0
2013-03-03 13:13:36 +01:00
Dean Troyer
41bf452023 Handle nested xtrace states
The lib/database abstraction includes the appropriate database file that also
contains the $XTRACE bits at entry and exit.  The nested XTRACE handling overwrote
the value from lib/database.  So...make the nested files use their own
XTRACE variables.

Change-Id: Ibdfc8d7d1e1457a9bc889b781ce176b417789ea1
2013-01-28 14:32:05 -06:00
Joe Gordon
767cd63179 Set MySQL slow log to record every query
Since devstack is for development, lets record all SQL queries to enable
debugging, and further development.

Change-Id: Idb4078a0d3a84151ad4c506f8861637d84ae47ad
2013-01-22 11:08:24 -05:00
Monty Taylor
7c73e8dee7 Enable MySQL slow query log.
Change-Id: I3db33839bea28abaff01f1d7b7d6698c5dd2c083
2013-01-14 05:20:06 -08:00
Dean Troyer
6d04fd7ba5 Holiday docs and comment formatting cleanup
Change-Id: Ia4ca88c67d3b94e306a79a669805a2fa1b0dc069
2012-12-28 18:03:10 -06:00
Vincent Untz
00011c0847 Add is_fedora and exit_distro_not_supported functions
Between is_fedora, is_ubuntu and is_suse, we can make the code a bit
simpler to read. We also use exit_distro_not_supported to identify
places where we need implementation details for new distros.

As "/sbin/service --skip-redirect" is Fedora-specific, guard this with a
is_fedora test too.

Change-Id: Ic77c0697ed9be0dbb5df8e73da93463e76025f0c
2012-12-07 09:06:07 +01:00
Vincent Untz
c18b965152 Add is_ubuntu function
This replaces all of the [[ "$os_PACKAGE" = "deb" ]] tests, except when
those tests are before straight calls to dpkg.

Change-Id: I8a3ebf1b1bc5a55d736f9258d5ba1d24dabf04ea
2012-12-04 18:30:13 +01:00
Vincent Untz
ca5c471386 Add package names for openSUSE/SLE
Change-Id: I487cc7b8bd228ff77c9881528e3395cbe3c43d4a
2012-11-28 16:26:53 +01:00
Vincent Untz
856a11e0e4 Add partial openSUSE/SLE support
Note that this is the first part of the support. A second part involves
dealing with the package names.

Among the changes:
 - add several functions to determine some distro-specific behavior (how
   to call usermod, if some features are available on the distro, etc.)
 - correctly detect openSUSE and SLE in GetOSVersion, and set DISTRO
   accordingly
 - new is_suse() function to check if running on a SUSE-based distro
 - use zypper to install packages
 - adapt apache virtual host configuration for openSUSE
 - some simple fixes (path to pip, mysql service name)

Change-Id: Id2f7c9e18a1c4a7b7cea262ea7959d183e4b0cf0
2012-11-28 16:22:12 +01: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