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
This commit is contained in:
Attila Fazekas 2015-01-26 16:39:57 +01:00
parent 55383f1a9b
commit 1f316beb20
18 changed files with 44 additions and 235 deletions

View File

@ -24,7 +24,7 @@ Q: Then why selinux in enforcing mode?
by packaging in "real" deployments. To remove additional protections by packaging in "real" deployments. To remove additional protections
that will be desired/required in production would be a step that will be desired/required in production would be a step
backward. backward.
Q: But selinux is disabled in RHEL 6! Q: But selinux is disabled in RHEL!
A: Today it is, yes. That is a specific exception that certain A: Today it is, yes. That is a specific exception that certain
DevStack contributors fought strongly against. The primary reason it DevStack contributors fought strongly against. The primary reason it
was allowed was to support using RHEL6 as the Python 2.6 test was allowed was to support using RHEL6 as the Python 2.6 test
@ -70,11 +70,6 @@ Q: What about Fedora/RHEL/CentOS?
Q: Are there any differences between Ubuntu and Fedora support? Q: Are there any differences between Ubuntu and Fedora support?
A: Neutron is not fully supported prior to Fedora 18 due lack of A: Neutron is not fully supported prior to Fedora 18 due lack of
OpenVSwitch packages. OpenVSwitch packages.
Q: How about RHEL 6?
A: RHEL 6 has Python 2.6 and many old modules packaged and is a
challenge to support. There are a number of specific RHEL6
work-arounds in ``stack.sh`` to handle this. But the testing on py26
is valuable so we do it...
Operation and Configuration Operation and Configuration
=========================== ===========================

View File

@ -32,7 +32,3 @@ Listen %ADMINPORT%
%SSLCERTFILE% %SSLCERTFILE%
%SSLKEYFILE% %SSLKEYFILE%
</VirtualHost> </VirtualHost>
# Workaround for missing path on RHEL6, see
# https://bugzilla.redhat.com/show_bug.cgi?id=1121019
WSGISocketPrefix /var/run/%APACHE_NAME%

View File

@ -1,16 +0,0 @@
diff -r b2efb7df637b discover.py
--- a/discover.py Thu Mar 24 00:31:02 2011 -0400
+++ b/discover.py Thu Nov 28 12:02:19 2013 +0000
@@ -82,7 +82,11 @@
"""
testMethodPrefix = 'test'
sortTestMethodsUsing = cmp
- suiteClass = unittest.TestSuite
+ try:
+ import unittest2
+ suiteClass = unittest2.TestSuite
+ except ImportError:
+ suiteClass = unittest.TestSuite
_top_level_dir = None
def loadTestsFromTestCase(self, testCaseClass):

View File

@ -3,4 +3,4 @@ scsi-target-utils
qemu-img qemu-img
postgresql-devel postgresql-devel
iscsi-initiator-utils iscsi-initiator-utils
python-lxml #dist:f19,f20,f21,rhel7 python-lxml

View File

@ -13,7 +13,6 @@ libxml2-devel
libxslt-devel libxslt-devel
psmisc psmisc
pylint pylint
python-prettytable # dist:rhel6 [1]
python-unittest2 python-unittest2
python-virtualenv python-virtualenv
python-devel python-devel
@ -27,8 +26,3 @@ bc
libyaml-devel libyaml-devel
gettext # used for compiling message catalogs gettext # used for compiling message catalogs
net-tools net-tools
# [1] : some of installed tools have unversioned dependencies on this,
# but others have versioned (<=0.7). So if a later version (0.7.1)
# gets installed in response to an unversioned dependency, it breaks.
# This pre-installs a compatible 0.6(ish) version from RHEL

View File

@ -6,8 +6,8 @@ postgresql-devel # testonly
python-argparse python-argparse
python-eventlet python-eventlet
python-greenlet python-greenlet
python-lxml #dist:f19,f20,f21,rhel7 python-lxml
python-paste-deploy #dist:f19,f20,f21,rhel7 python-paste-deploy
python-routes python-routes
python-sqlalchemy python-sqlalchemy
pyxattr pyxattr

View File

@ -12,8 +12,8 @@ python-httplib2
python-migrate python-migrate
python-mox python-mox
python-nose python-nose
python-paste #dist:f19,f20,f21 python-paste
python-paste-deploy #dist:f19,f20,f21 python-paste-deploy
python-routes python-routes
python-sqlalchemy python-sqlalchemy
python-webob python-webob

View File

@ -1,10 +1,10 @@
MySQL-python MySQL-python
python-greenlet python-greenlet
libxslt-devel # dist:f20,f21 libxslt-devel
python-lxml #dist:f19,f20,f21 python-lxml
python-paste #dist:f19,f20,f21 python-paste
python-paste-deploy #dist:f19,f20,f21 python-paste-deploy
python-paste-script #dist:f19,f20,f21 python-paste-script
python-routes python-routes
python-sqlalchemy python-sqlalchemy
python-webob python-webob

View File

@ -12,9 +12,8 @@ openvswitch # NOPRIME
python-eventlet python-eventlet
python-greenlet python-greenlet
python-iso8601 python-iso8601
#rhel6 gets via pip python-paste
python-paste # dist:f19,f20,f21,rhel7 python-paste-deploy
python-paste-deploy # dist:f19,f20,f21,rhel7
python-qpid # NOPRIME python-qpid # NOPRIME
python-routes python-routes
python-sqlalchemy python-sqlalchemy

View File

@ -29,11 +29,9 @@ python-iso8601
python-lockfile python-lockfile
python-migrate python-migrate
python-mox python-mox
python-paramiko # dist:f19,f20,f21,rhel7 python-paramiko
# ^ on RHEL6, brings in python-crypto which conflicts with version from python-paste
# pip we need python-paste-deploy
python-paste # dist:f19,f20,f21,rhel7
python-paste-deploy # dist:f19,f20,f21,rhel7
python-qpid # NOPRIME python-qpid # NOPRIME
python-routes python-routes
python-sqlalchemy python-sqlalchemy

View File

@ -6,7 +6,7 @@ python-eventlet
python-greenlet python-greenlet
python-netifaces python-netifaces
python-nose python-nose
python-paste-deploy # dist:f19,f20,f21,rhel7 python-paste-deploy
python-simplejson python-simplejson
python-webob python-webob
pyxattr pyxattr

View File

@ -303,18 +303,6 @@ function configure_cinder {
configure_cinder_driver configure_cinder_driver
fi fi
if is_fedora && [[ $DISTRO =~ (rhel6) ]]; then
# Cinder clones are slightly larger due to some extra
# metadata. RHEL6 will not allow auto-extending of LV's
# without this, leading to clones giving hard-to-track disk
# I/O errors.
# see https://bugzilla.redhat.com/show_bug.cgi?id=975052
sudo sed -i~ \
-e 's/snapshot_autoextend_threshold =.*/snapshot_autoextend_threshold = 80/' \
-e 's/snapshot_autoextend_percent =.*/snapshot_autoextend_percent = 20/' \
/etc/lvm/lvm.conf
fi
iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS" iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS"
iniset $CINDER_CONF DEFAULT glance_api_servers "${GLANCE_SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}" iniset $CINDER_CONF DEFAULT glance_api_servers "${GLANCE_SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}"
@ -446,12 +434,8 @@ function start_cinder {
if is_ubuntu; then if is_ubuntu; then
sudo service tgt restart sudo service tgt restart
elif is_fedora; then elif is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then # bypass redirection to systemctl during restart
sudo /sbin/service tgtd restart sudo /sbin/service --skip-redirect tgtd restart
else
# bypass redirection to systemctl during restart
sudo /sbin/service --skip-redirect tgtd restart
fi
elif is_suse; then elif is_suse; then
restart_service tgtd restart_service tgtd
else else

View File

@ -17,11 +17,7 @@ register_database mysql
# Linux distros, thank you for being incredibly consistent # Linux distros, thank you for being incredibly consistent
MYSQL=mysql MYSQL=mysql
if is_fedora; then if is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then MYSQL=mariadb
MYSQL=mysqld
else
MYSQL=mariadb
fi
fi fi
# Functions # Functions
@ -38,15 +34,9 @@ function cleanup_database_mysql {
sudo rm -rf /etc/mysql sudo rm -rf /etc/mysql
return return
elif is_fedora; then elif is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then stop_service mariadb
stop_service mysqld uninstall_package mariadb-server
uninstall_package mysql-server sudo rm -rf /var/lib/mysql
sudo rm -rf /var/lib/mysql
else
stop_service mariadb
uninstall_package mariadb-server
sudo rm -rf /var/lib/mysql
fi
elif is_suse; then elif is_suse; then
stop_service mysql stop_service mysql
uninstall_package mysql-community-server uninstall_package mysql-community-server
@ -70,11 +60,7 @@ function configure_database_mysql {
my_conf=/etc/mysql/my.cnf my_conf=/etc/mysql/my.cnf
mysql=mysql mysql=mysql
elif is_fedora; then elif is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then mysql=mariadb
mysql=mysqld
else
mysql=mariadb
fi
my_conf=/etc/my.cnf my_conf=/etc/my.cnf
elif is_suse; then elif is_suse; then
my_conf=/etc/my.cnf my_conf=/etc/my.cnf
@ -110,7 +96,7 @@ function configure_database_mysql {
if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then
echo_summary "Enabling MySQL query logging" echo_summary "Enabling MySQL query logging"
if is_fedora && ! [[ $DISTRO =~ (rhel6) ]]; then if is_fedora; then
slow_log=/var/log/mariadb/mariadb-slow.log slow_log=/var/log/mariadb/mariadb-slow.log
else else
slow_log=/var/log/mysql/mysql-slow.log slow_log=/var/log/mysql/mysql-slow.log
@ -158,11 +144,7 @@ EOF
fi fi
# Install mysql-server # Install mysql-server
if is_fedora; then if is_fedora; then
if [[ $DISTRO =~ (rhel6) ]]; then install_package mariadb-server
install_package mysql-server
else
install_package mariadb-server
fi
elif is_ubuntu; then elif is_ubuntu; then
install_package mysql-server install_package mysql-server
elif is_suse; then elif is_suse; then

View File

@ -49,11 +49,7 @@ function configure_database_postgresql {
pg_hba=/var/lib/pgsql/data/pg_hba.conf pg_hba=/var/lib/pgsql/data/pg_hba.conf
pg_conf=/var/lib/pgsql/data/postgresql.conf pg_conf=/var/lib/pgsql/data/postgresql.conf
if ! sudo [ -e $pg_hba ]; then if ! sudo [ -e $pg_hba ]; then
if ! [[ $DISTRO =~ (rhel6) ]]; then sudo postgresql-setup initdb
sudo postgresql-setup initdb
else
sudo service postgresql initdb
fi
fi fi
elif is_ubuntu; then elif is_ubuntu; then
pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname` pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname`

View File

@ -72,14 +72,6 @@ function _horizon_config_set {
# cleanup_horizon() - Remove residual data files, anything left over from previous # cleanup_horizon() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up # runs that a clean run would need to clean up
function cleanup_horizon { function cleanup_horizon {
if is_fedora && [[ $DISTRO =~ (rhel6) ]]; then
# If ``/usr/bin/node`` points into ``$DEST``
# we installed it via ``install_nodejs``
if [[ $(readlink -f /usr/bin/node) =~ ($DEST) ]]; then
sudo rm /usr/bin/node
fi
fi
local horizon_conf=$(apache_site_config_for horizon) local horizon_conf=$(apache_site_config_for horizon)
sudo rm -f $horizon_conf sudo rm -f $horizon_conf
} }

View File

@ -37,8 +37,7 @@ function install_libvirt {
# Note there is a difference between F20 rackspace cloud images # Note there is a difference between F20 rackspace cloud images
# and HP images used in the gate; rackspace has firewalld but hp # and HP images used in the gate; rackspace has firewalld but hp
# cloud doesn't. RHEL6 doesn't have firewalld either. So we # cloud doesn't.
# don't care if it fails.
if is_fedora && is_package_installed firewalld; then if is_fedora && is_package_installed firewalld; then
sudo service firewalld restart || true sudo service firewalld restart || true
fi fi
@ -68,34 +67,12 @@ EOF
fi fi
if is_fedora || is_suse; then if is_fedora || is_suse; then
if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then # Starting with fedora 18 and opensuse-12.3 enable stack-user to
cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla # virsh -c qemu:///system by creating a policy-kit rule for
[libvirt Management Access] # stack-user using the new Javascript syntax
Identity=unix-group:$LIBVIRT_GROUP rules_dir=/etc/polkit-1/rules.d
Action=org.libvirt.unix.manage sudo mkdir -p $rules_dir
ResultAny=yes cat <<EOF | sudo tee $rules_dir/50-libvirt-$STACK_USER.rules
ResultInactive=yes
ResultActive=yes
EOF
elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
# openSUSE < 12.3 or SLE
# Work around the fact that polkit-default-privs overrules pklas
# with 'unix-group:$group'.
cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
[libvirt Management Access]
Identity=unix-user:$STACK_USER
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
EOF
else
# Starting with fedora 18 and opensuse-12.3 enable stack-user to
# virsh -c qemu:///system by creating a policy-kit rule for
# stack-user using the new Javascript syntax
rules_dir=/etc/polkit-1/rules.d
sudo mkdir -p $rules_dir
cat <<EOF | sudo tee $rules_dir/50-libvirt-$STACK_USER.rules
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
if (action.id == 'org.libvirt.unix.manage' && if (action.id == 'org.libvirt.unix.manage' &&
subject.user == '$STACK_USER') { subject.user == '$STACK_USER') {
@ -103,8 +80,7 @@ polkit.addRule(function(action, subject) {
} }
}); });
EOF EOF
unset rules_dir unset rules_dir
fi
fi fi
# The user that nova runs as needs to be member of **libvirtd** group otherwise # The user that nova runs as needs to be member of **libvirtd** group otherwise

View File

@ -152,7 +152,7 @@ source $TOP_DIR/stackrc
# Warn users who aren't on an explicitly supported distro, but allow them to # Warn users who aren't on an explicitly supported distro, but allow them to
# override check and attempt installation with ``FORCE=yes ./stack`` # override check and attempt installation with ``FORCE=yes ./stack``
if [[ ! ${DISTRO} =~ (precise|trusty|7.0|wheezy|sid|testing|jessie|f20|f21|rhel6|rhel7) ]]; then if [[ ! ${DISTRO} =~ (precise|trusty|7.0|wheezy|sid|testing|jessie|f20|f21|rhel7) ]]; then
echo "WARNING: this script has not been tested on $DISTRO" echo "WARNING: this script has not been tested on $DISTRO"
if [[ "$FORCE" != "yes" ]]; then if [[ "$FORCE" != "yes" ]]; then
die $LINENO "If you wish to run this script anyway run with FORCE=yes" die $LINENO "If you wish to run this script anyway run with FORCE=yes"
@ -221,7 +221,7 @@ fi
# Some distros need to add repos beyond the defaults provided by the vendor # Some distros need to add repos beyond the defaults provided by the vendor
# to pick up required packages. # to pick up required packages.
if is_fedora && [[ $DISTRO == "rhel6" || $DISTRO == "rhel7" ]]; then if is_fedora && [[ $DISTRO == "rhel7" ]]; then
# RHEL requires EPEL for many Open Stack dependencies # RHEL requires EPEL for many Open Stack dependencies
# note we always remove and install latest -- some environments # note we always remove and install latest -- some environments
@ -239,16 +239,10 @@ if is_fedora && [[ $DISTRO == "rhel6" || $DISTRO == "rhel7" ]]; then
# $releasever directly in .repo file we create below. However # $releasever directly in .repo file we create below. However
# RHEL gives a $releasever of "6Server" which breaks the path; # RHEL gives a $releasever of "6Server" which breaks the path;
# see https://bugzilla.redhat.com/show_bug.cgi?id=1150759 # see https://bugzilla.redhat.com/show_bug.cgi?id=1150759
if [[ $DISTRO == "rhel7" ]]; then
epel_ver="7"
elif [[ $DISTRO == "rhel6" ]]; then
epel_ver="6"
fi
cat <<EOF | sudo tee /etc/yum.repos.d/epel-bootstrap.repo cat <<EOF | sudo tee /etc/yum.repos.d/epel-bootstrap.repo
[epel-bootstrap] [epel-bootstrap]
name=Bootstrap EPEL name=Bootstrap EPEL
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-$epel_ver&arch=\$basearch mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=\$basearch
failovermethod=priority failovermethod=priority
enabled=0 enabled=0
gpgcheck=0 gpgcheck=0
@ -261,22 +255,10 @@ EOF
# ... and also optional to be enabled # ... and also optional to be enabled
is_package_installed yum-utils || install_package yum-utils is_package_installed yum-utils || install_package yum-utils
if [[ $DISTRO == "rhel7" ]]; then sudo yum-config-manager --enable rhel-7-server-optional-rpms
OPTIONAL_REPO=rhel-7-server-optional-rpms
elif [[ $DISTRO == "rhel6" ]]; then
OPTIONAL_REPO=rhel-6-server-optional-rpms
fi
sudo yum-config-manager --enable ${OPTIONAL_REPO}
# Installing Open vSwitch on RHEL requires enabling the RDO repo. RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"}
# Note no juno packages for rhel6 RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-juno"}
if [[ $DISTRO == "rhel6" ]]; then
RHEL_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm"}
RHEL_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-icehouse"}
elif [[ $DISTRO == "rhel7" ]]; then
RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"}
RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-juno"}
fi
if ! sudo yum repolist enabled $RHEL_RDO_REPO_ID | grep -q $RHEL_RDO_REPO_ID; then if ! sudo yum repolist enabled $RHEL_RDO_REPO_ID | grep -q $RHEL_RDO_REPO_ID; then
echo "RDO repo not detected; installing" echo "RDO repo not detected; installing"
@ -362,12 +344,6 @@ function echo_nolog {
echo $@ >&3 echo $@ >&3
} }
if is_fedora && [ $DISTRO == "rhel6" ]; then
# poor old python2.6 doesn't have argparse by default, which
# outfilter.py uses
is_package_installed python-argparse || install_package python-argparse
fi
# Set up logging for ``stack.sh`` # Set up logging for ``stack.sh``
# Set ``LOGFILE`` to turn on logging # Set ``LOGFILE`` to turn on logging
# Append '.xxxxxxxx' to the given name to maintain history # Append '.xxxxxxxx' to the given name to maintain history

View File

@ -12,12 +12,10 @@
# - httplib2 0.8 permissions are 600 in the package and # - httplib2 0.8 permissions are 600 in the package and
# pip 1.4 doesn't fix it (1.3 did) # pip 1.4 doesn't fix it (1.3 did)
# #
# - RHEL6: # - Fedora:
#
# - set selinux not enforcing # - set selinux not enforcing
# - (re)start messagebus daemon # - uninstall firewalld (f20 only)
# - remove distro packages python-crypto and python-lxml
# - pre-install hgtools to work around a bug in RHEL6 distribute
# If TOP_DIR is set we're being sourced rather than running stand-alone # If TOP_DIR is set we're being sourced rather than running stand-alone
# or in a sub-shell # or in a sub-shell
@ -125,64 +123,3 @@ if is_fedora; then
fi fi
fi fi
# RHEL6
# -----
if [[ $DISTRO =~ (rhel6) ]]; then
# install_pip.sh installs the latest setuptools over the packaged
# version. We can't really uninstall the packaged version if it
# is there, because it may remove other important things like
# cloud-init. Things work, but there can be an old egg file left
# around from the package that causes some really strange
# setuptools errors. Remove it, if it is there
sudo rm -f /usr/lib/python2.6/site-packages/setuptools-0.6*.egg-info
# If the ``dbus`` package was installed by DevStack dependencies the
# uuid may not be generated because the service was never started (PR#598200),
# causing Nova to stop later on complaining that ``/var/lib/dbus/machine-id``
# does not exist.
sudo service messagebus restart
# The following workarounds break xenserver
if [ "$VIRT_DRIVER" != 'xenserver' ]; then
# An old version of ``python-crypto`` (2.0.1) may be installed on a
# fresh system via Anaconda and the dependency chain
# ``cas`` -> ``python-paramiko`` -> ``python-crypto``.
# ``pip uninstall pycrypto`` will remove the packaged ``.egg-info``
# file but leave most of the actual library files behind in
# ``/usr/lib64/python2.6/Crypto``. Later ``pip install pycrypto``
# will install over the packaged files resulting
# in a useless mess of old, rpm-packaged files and pip-installed files.
# Remove the package so that ``pip install python-crypto`` installs
# cleanly.
# Note: other RPM packages may require ``python-crypto`` as well.
# For example, RHEL6 does not install ``python-paramiko packages``.
uninstall_package python-crypto
# A similar situation occurs with ``python-lxml``, which is required by
# ``ipa-client``, an auditing package we don't care about. The
# build-dependencies needed for ``pip install lxml`` (``gcc``,
# ``libxml2-dev`` and ``libxslt-dev``) are present in
# ``files/rpms/general``.
uninstall_package python-lxml
fi
# ``setup.py`` contains a ``setup_requires`` package that is supposed
# to be transient. However, RHEL6 distribute has a bug where
# ``setup_requires`` registers entry points that are not cleaned
# out properly after the setup-phase resulting in installation failures
# (bz#924038). Pre-install the problem package so the ``setup_requires``
# dependency is satisfied and it will not be installed transiently.
# Note we do this before the track-depends in ``stack.sh``.
pip_install hgtools
# workaround for https://code.google.com/p/unittest-ext/issues/detail?id=79
install_package python-unittest2 patch
pip_install discover
(cd /usr/lib/python2.6/site-packages/; sudo patch <"$FILES/patches/unittest2-discover.patch" || echo 'Assume already applied')
# Make sure the discover.pyc is up to date
sudo rm /usr/lib/python2.6/site-packages/discover.pyc || true
sudo python -c 'import discover'
fi