Fix grep on MySQL configuration file

The file is not readable by non-root users (at least on openSUSE), so we
need to use sudo.

Change-Id: I42fff066a60318a954110736d5352387888931e8
Register cinder when using sql keystone catalog.

* Fixes bug #1020735

Change-Id: Ibd954cdda3c855800ae1080950c62dd71b094a01
Merge "Fix grep on MySQL configuration file"
Add update_repos function to update package repositories

This helps us ensure that we update the repositories only the first time
we need to install packages, and also that we have a place where we can
put the distro-specific code for updating repositories.

Change-Id: Id987aa7742f5d6807bc97eb6784cf18557c919d2
Ensure that we have access to /usr/sbin binaries in stack.sh

We need to add the sbin paths to the secure path in sudoers for the user
running the script, to make sure that running sbin binaries from sudo
will work.

Change-Id: I7942407df768bfa8dd035f15fa8b43ba05319779
Use latin1 character set when creating the nova database

This works around bug 829209, where we end up with a "'Specified key was
too long" error.

Change-Id: I81e6ed476e8a310fe01809e9afcc2c8d5360e9df
Stop avoiding calling systemctl for tgtd on Fedora

The bug that lead to this workaround was fixed and an update is
available for Fedora:
  https://bugzilla.redhat.com/show_bug.cgi?id=797913

Keeping this workaround would be annoying as --skip-redirect doesn't
exist on all rpm-based distributions, and we'd have to remember using it
everywhere we interact with the tgtd service.

Change-Id: I22a5d4fe154ea04bd35d89db6d63734b5bd405aa
Start tgtd service after installing the rpm

The later call to tgtadm needs the daemon to be running, and the rpm
package doesn't start it.

Change-Id: Ia72b935575ed8b7c635e8f8edeea835754b2d49f
Do not pass -U to useradd

The -U option doesn't have the same meaning on all distributions,
unfortunately: in some cases, it means "create a group for the user with
the same name", and in others, it means "default umask for the user".

Instead, manually create a stack group with groupadd.

Change-Id: I32f4c0603785e54a465c2d3b47a1852b8635fde0
Add is_package_installed function to know if a package is installed

This helps reduce the distro-dependent code in stack.sh, and also fixes
the bug where "rpm -qa | grep sudo" will work if gnome-sudoku is
installed.

Change-Id: Ib1330b29b915b41d9724197edd791f0d4e0fe373
Add a way to map package names from one distro to another

To support different distributions, we currently list packages needed
for each distribution. This is not fun, especially as most package names
are common. Also, to properly support this in all the code, we need to
add several if/elif/else/fi.

Instead, we can use a map to match the package names from one distro
(that we'll consider as a basis, with package names used in the code) to
the package names of another distribution. This means we simply need to
add a file containing the mapping to support this other distribution --
at least, in terms of packaging.

Mapping files are in files/package-maps/ and are named after the
vendors. Format is:

original_name first_package,second_package

This allows mapping a single package to more than one package.

To keep the same name for the mapping, just put:

original_name

(or alternatively, do not even put the file in the mapping, but we might
add tests to make sure there's a mapping defined for each package)

Change-Id: I01b29ec73a7294f11d74adcf2c9a62797d88383c
Correctly detect openSUSE and SLE in GetOSVersion

Manually fix the vendor to be openSUSE instead of SUSE LINUX (since I
think it's more correct) when using lsb_release.

Also support directly fetching the information from /etc/SuSE-release.

Change-Id: Icb1266edf650fc78eb81971a8b53db94035bb85b
Add is_suse() function to check is running on a SUSE-based distro

While openSUSE and SLE will have some differences (hence a different
vendor), they are very close. So this helper function will be useful.

Change-Id: I2d3b0c80aca53478d43c1e1a9593e28573fd75b7
Add zypper_install function to install packages on openSUSE

This is based on the yum_install function.

Change-Id: Iebc130237daa15802d62e9fb37b134656588ec2c
Define DISTRO for openSUSE and SLE

We use the obvious opensuse-$os_RELEASE (openSUSE-12.2) for openSUSE,
and sle$os_RELEASE (sle11) for SLE. If there's a service pack for SLE,
then we use sle11sp2.

Change-Id: Ie3b9f95b6fd238e7a817f2475275fc1e4b9e9a8f
Do not proceed if qpid is enabled and openSUSE/SLE is used

There's no qpid package for openSUSE/SLE right now.

Change-Id: If103c9a3d5da0833f98901759219fbed7812ce0a
Correctly set NOVA_ROOTWRAP variable on openSUSE/SLE

nova-rootwrap is in /usr/local/bin, not /usr/bin.

Change-Id: I1f746be06116d7f5ebb173c4b264148743622592
Fix service name for mysql in openSUSE/SLE

It is mysql, not mysqld.

Change-Id: Ia907030049d5e2a9fab1f5165658cc4038ae1179
Use the correct mysql service name everywhere

mysqld was hard-coded in another place.

Change-Id: I5b66ada02f3c4424384c728f1dadb4872bf4d490
Make the apache automatic configuration work for openSUSE/SLE

The package works in a different way than Fedora.

Change-Id: Ib285fb018f6c7e5a6c63c5b1eb769229cc73f727