Stop adding the stack user to the sudo or wheel group

This is not needed since we explicitly add a sudoers rule for the stack
user.

Change-Id: I4c63ab25811d55b7eee2677c954133dc3e7ae397
Use ip instead of ifconfig.
Should work on F16, F17 and Debian based systesm.

Change-Id: I22dd10097baebf6e7e396fcbf5e68a3dae63539f
Move get_packages() to functions.

This is a prerequisite to fixing the tools/build_uec* scripts to properly
install prereq packages.

Change-Id: I1c60f7b9a9d07076841d9aff524c0833dc987c66
Merge "Move get_packages() to functions."
Merge "Use ip instead of ifconfig. Should work on F16, F17 and Debian based systesm."
Fix bug 1020474 by correcting substitutions in configure_tempest.sh

This is caused by the following commit in tempest:
f38eaace9cb39d98b1203bd4c86b33d20501b7a3

Change-Id: I0cf6b49e81b696411a0c01f66c2b89508dc701b9
Merge "Stop adding the stack user to the sudo or wheel group"
Merge "Fix bug 1020474 by correcting substitutions in configure_tempest.sh"
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
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
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