Allow wget to handle Non-English output

The stack.sh has a loop to wait for keystone to start. But the output of wget tool has been globalized
which means it won't return the English word 'refused' on Non-English environment even the keystone is
not up. So the script will assume the keystone has been started and continue. The command of keystone
tenant-create always failed immediately after skipping this loop since it require keystone to be started
to authenticate. That's why you can see authentication error in the log because the tenant information
was not correctly set up.

Fix bug 1019942

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

Nova expects the latin1 character set to be used in its database by
default and then alters the database to utf8 when upgrading the
database (in 082_essex.py).

Nova works this way to work around bug 829209 ("Specified key was too
long" errors) that will be hit with the dns_domains table.

Change-Id: I81e6ed476e8a310fe01809e9afcc2c8d5360e9df
Use c-api for service when creating cinder user.

- cinder is not a service but c-api is.

Change-Id: I580fe91216d3fa066120dc774811bfe08119ca02
Merge "Allow wget to handle Non-English output"
Merge "Use latin1 character set when creating the nova database"
Merge "Use c-api for service when creating cinder user."
Add Cinder to ROOTWRAP_SUDOERS

 * Perform operations in lib/cinder
 * Use specific cidner-rootwrap file
 * Add root_helper to cinder.conf

Change-Id: Ibcae8bae2d06c9cbb4c41c39791e8dbdc8bbb0ac
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
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