From 1f316beb2052b715f077ef42279361026d1a24c3 Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Mon, 26 Jan 2015 16:39:57 +0100 Subject: [PATCH] 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 --- doc/source/faq.rst | 7 +-- files/apache-keystone.template | 4 -- files/patches/unittest2-discover.patch | 16 ------ files/rpms/cinder | 2 +- files/rpms/general | 6 --- files/rpms/glance | 4 +- files/rpms/horizon | 4 +- files/rpms/keystone | 10 ++-- files/rpms/neutron | 5 +- files/rpms/nova | 8 ++- files/rpms/swift | 2 +- lib/cinder | 20 +------- lib/databases/mysql | 32 +++--------- lib/databases/postgresql | 6 +-- lib/horizon | 8 --- lib/nova_plugins/functions-libvirt | 40 +++------------ stack.sh | 36 +++----------- tools/fixup_stuff.sh | 69 ++------------------------ 18 files changed, 44 insertions(+), 235 deletions(-) delete mode 100644 files/patches/unittest2-discover.patch diff --git a/doc/source/faq.rst b/doc/source/faq.rst index 92d794572e..f10c2eec36 100644 --- a/doc/source/faq.rst +++ b/doc/source/faq.rst @@ -24,7 +24,7 @@ Q: Then why selinux in enforcing mode? by packaging in "real" deployments. To remove additional protections that will be desired/required in production would be a step 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 DevStack contributors fought strongly against. The primary reason it 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? A: Neutron is not fully supported prior to Fedora 18 due lack of 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 =========================== diff --git a/files/apache-keystone.template b/files/apache-keystone.template index 2190d831c0..504dc01d21 100644 --- a/files/apache-keystone.template +++ b/files/apache-keystone.template @@ -32,7 +32,3 @@ Listen %ADMINPORT% %SSLCERTFILE% %SSLKEYFILE% - -# Workaround for missing path on RHEL6, see -# https://bugzilla.redhat.com/show_bug.cgi?id=1121019 -WSGISocketPrefix /var/run/%APACHE_NAME% diff --git a/files/patches/unittest2-discover.patch b/files/patches/unittest2-discover.patch deleted file mode 100644 index 347300d172..0000000000 --- a/files/patches/unittest2-discover.patch +++ /dev/null @@ -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): diff --git a/files/rpms/cinder b/files/rpms/cinder index eedff184dd..082a35af32 100644 --- a/files/rpms/cinder +++ b/files/rpms/cinder @@ -3,4 +3,4 @@ scsi-target-utils qemu-img postgresql-devel iscsi-initiator-utils -python-lxml #dist:f19,f20,f21,rhel7 +python-lxml diff --git a/files/rpms/general b/files/rpms/general index ee7cc12cef..13c8a87780 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -13,7 +13,6 @@ libxml2-devel libxslt-devel psmisc pylint -python-prettytable # dist:rhel6 [1] python-unittest2 python-virtualenv python-devel @@ -27,8 +26,3 @@ bc libyaml-devel gettext # used for compiling message catalogs 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 diff --git a/files/rpms/glance b/files/rpms/glance index acf0cc394b..a09b669309 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -6,8 +6,8 @@ postgresql-devel # testonly python-argparse python-eventlet python-greenlet -python-lxml #dist:f19,f20,f21,rhel7 -python-paste-deploy #dist:f19,f20,f21,rhel7 +python-lxml +python-paste-deploy python-routes python-sqlalchemy pyxattr diff --git a/files/rpms/horizon b/files/rpms/horizon index 82385ed06c..585c36cfde 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -12,8 +12,8 @@ python-httplib2 python-migrate python-mox python-nose -python-paste #dist:f19,f20,f21 -python-paste-deploy #dist:f19,f20,f21 +python-paste +python-paste-deploy python-routes python-sqlalchemy python-webob diff --git a/files/rpms/keystone b/files/rpms/keystone index 8b0953dd69..45492e0de6 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -1,10 +1,10 @@ MySQL-python python-greenlet -libxslt-devel # dist:f20,f21 -python-lxml #dist:f19,f20,f21 -python-paste #dist:f19,f20,f21 -python-paste-deploy #dist:f19,f20,f21 -python-paste-script #dist:f19,f20,f21 +libxslt-devel +python-lxml +python-paste +python-paste-deploy +python-paste-script python-routes python-sqlalchemy python-webob diff --git a/files/rpms/neutron b/files/rpms/neutron index 5450408a35..59152d6e93 100644 --- a/files/rpms/neutron +++ b/files/rpms/neutron @@ -12,9 +12,8 @@ openvswitch # NOPRIME python-eventlet python-greenlet python-iso8601 -#rhel6 gets via pip -python-paste # dist:f19,f20,f21,rhel7 -python-paste-deploy # dist:f19,f20,f21,rhel7 +python-paste +python-paste-deploy python-qpid # NOPRIME python-routes python-sqlalchemy diff --git a/files/rpms/nova b/files/rpms/nova index 07f13c7071..557de908f1 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -29,11 +29,9 @@ python-iso8601 python-lockfile python-migrate python-mox -python-paramiko # dist:f19,f20,f21,rhel7 -# ^ on RHEL6, brings in python-crypto which conflicts with version from -# pip we need -python-paste # dist:f19,f20,f21,rhel7 -python-paste-deploy # dist:f19,f20,f21,rhel7 +python-paramiko +python-paste +python-paste-deploy python-qpid # NOPRIME python-routes python-sqlalchemy diff --git a/files/rpms/swift b/files/rpms/swift index ccda22bcc8..0fcdb0fe27 100644 --- a/files/rpms/swift +++ b/files/rpms/swift @@ -6,7 +6,7 @@ python-eventlet python-greenlet python-netifaces python-nose -python-paste-deploy # dist:f19,f20,f21,rhel7 +python-paste-deploy python-simplejson python-webob pyxattr diff --git a/lib/cinder b/lib/cinder index 6eee880fef..12bac8cb38 100644 --- a/lib/cinder +++ b/lib/cinder @@ -303,18 +303,6 @@ function configure_cinder { configure_cinder_driver 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 glance_api_servers "${GLANCE_SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}" @@ -446,12 +434,8 @@ function start_cinder { if is_ubuntu; then sudo service tgt restart elif is_fedora; then - if [[ $DISTRO =~ (rhel6) ]]; then - sudo /sbin/service tgtd restart - else - # bypass redirection to systemctl during restart - sudo /sbin/service --skip-redirect tgtd restart - fi + # bypass redirection to systemctl during restart + sudo /sbin/service --skip-redirect tgtd restart elif is_suse; then restart_service tgtd else diff --git a/lib/databases/mysql b/lib/databases/mysql index 2f3b6d4123..72c0f82b4a 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -17,11 +17,7 @@ register_database mysql # Linux distros, thank you for being incredibly consistent MYSQL=mysql if is_fedora; then - if [[ $DISTRO =~ (rhel6) ]]; then - MYSQL=mysqld - else - MYSQL=mariadb - fi + MYSQL=mariadb fi # Functions @@ -38,15 +34,9 @@ function cleanup_database_mysql { sudo rm -rf /etc/mysql return elif is_fedora; then - if [[ $DISTRO =~ (rhel6) ]]; then - stop_service mysqld - uninstall_package mysql-server - sudo rm -rf /var/lib/mysql - else - stop_service mariadb - uninstall_package mariadb-server - sudo rm -rf /var/lib/mysql - fi + stop_service mariadb + uninstall_package mariadb-server + sudo rm -rf /var/lib/mysql elif is_suse; then stop_service mysql uninstall_package mysql-community-server @@ -70,11 +60,7 @@ function configure_database_mysql { my_conf=/etc/mysql/my.cnf mysql=mysql elif is_fedora; then - if [[ $DISTRO =~ (rhel6) ]]; then - mysql=mysqld - else - mysql=mariadb - fi + mysql=mariadb my_conf=/etc/my.cnf elif is_suse; then my_conf=/etc/my.cnf @@ -110,7 +96,7 @@ function configure_database_mysql { if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then echo_summary "Enabling MySQL query logging" - if is_fedora && ! [[ $DISTRO =~ (rhel6) ]]; then + if is_fedora; then slow_log=/var/log/mariadb/mariadb-slow.log else slow_log=/var/log/mysql/mysql-slow.log @@ -158,11 +144,7 @@ EOF fi # Install mysql-server if is_fedora; then - if [[ $DISTRO =~ (rhel6) ]]; then - install_package mysql-server - else - install_package mariadb-server - fi + install_package mariadb-server elif is_ubuntu; then install_package mysql-server elif is_suse; then diff --git a/lib/databases/postgresql b/lib/databases/postgresql index ad8cdc77a2..317e0ebf53 100644 --- a/lib/databases/postgresql +++ b/lib/databases/postgresql @@ -49,11 +49,7 @@ function configure_database_postgresql { pg_hba=/var/lib/pgsql/data/pg_hba.conf pg_conf=/var/lib/pgsql/data/postgresql.conf if ! sudo [ -e $pg_hba ]; then - if ! [[ $DISTRO =~ (rhel6) ]]; then - sudo postgresql-setup initdb - else - sudo service postgresql initdb - fi + sudo postgresql-setup initdb fi elif is_ubuntu; then pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname` diff --git a/lib/horizon b/lib/horizon index aa70bd59eb..122d516673 100644 --- a/lib/horizon +++ b/lib/horizon @@ -72,14 +72,6 @@ function _horizon_config_set { # cleanup_horizon() - Remove residual data files, anything left over from previous # runs that a clean run would need to clean up 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) sudo rm -f $horizon_conf } diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index c136e352df..4d617e8b5e 100644 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -37,8 +37,7 @@ function install_libvirt { # Note there is a difference between F20 rackspace cloud images # and HP images used in the gate; rackspace has firewalld but hp - # cloud doesn't. RHEL6 doesn't have firewalld either. So we - # don't care if it fails. + # cloud doesn't. if is_fedora && is_package_installed firewalld; then sudo service firewalld restart || true fi @@ -68,34 +67,12 @@ EOF fi if is_fedora || is_suse; then - if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then - cat <&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 ``LOGFILE`` to turn on logging # Append '.xxxxxxxx' to the given name to maintain history diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh index c7f1efa441..cc5275fe45 100755 --- a/tools/fixup_stuff.sh +++ b/tools/fixup_stuff.sh @@ -12,12 +12,10 @@ # - httplib2 0.8 permissions are 600 in the package and # pip 1.4 doesn't fix it (1.3 did) # -# - RHEL6: -# +# - Fedora: # - set selinux not enforcing -# - (re)start messagebus daemon -# - remove distro packages python-crypto and python-lxml -# - pre-install hgtools to work around a bug in RHEL6 distribute +# - uninstall firewalld (f20 only) + # If TOP_DIR is set we're being sourced rather than running stand-alone # or in a sub-shell @@ -125,64 +123,3 @@ if is_fedora; then 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