Browse code

Move RHEL6 hacks to tools/fixup_stuff.sh

Change-Id: Ice983bc16379bc2bc25659c37cfc16b63fdfc34b

Dean Troyer authored on 2013/08/10 09:51:20
Showing 2 changed files
... ...
@@ -589,64 +589,6 @@ $TOP_DIR/tools/install_pip.sh
589 589
 # Do the ugly hacks for borken packages and distros
590 590
 $TOP_DIR/tools/fixup_stuff.sh
591 591
 
592
-
593
-# System-specific preconfigure
594
-# ============================
595
-
596
-if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
597
-    # Disable selinux to avoid configuring to allow Apache access
598
-    # to Horizon files or run nodejs (LP#1175444)
599
-    if selinuxenabled; then
600
-        sudo setenforce 0
601
-    fi
602
-
603
-    # The following workarounds break xenserver
604
-    if [ "$VIRT_DRIVER" != 'xenserver' ]; then
605
-        # An old version of ``python-crypto`` (2.0.1) may be installed on a
606
-        # fresh system via Anaconda and the dependency chain
607
-        # ``cas`` -> ``python-paramiko`` -> ``python-crypto``.
608
-        # ``pip uninstall pycrypto`` will remove the packaged ``.egg-info``
609
-        #  file but leave most of the actual library files behind in
610
-        # ``/usr/lib64/python2.6/Crypto``. Later ``pip install pycrypto``
611
-        # will install over the packaged files resulting
612
-        # in a useless mess of old, rpm-packaged files and pip-installed files.
613
-        # Remove the package so that ``pip install python-crypto`` installs
614
-        # cleanly.
615
-        # Note: other RPM packages may require ``python-crypto`` as well.
616
-        # For example, RHEL6 does not install ``python-paramiko packages``.
617
-        uninstall_package python-crypto
618
-
619
-        # A similar situation occurs with ``python-lxml``, which is required by
620
-        # ``ipa-client``, an auditing package we don't care about.  The
621
-        # build-dependencies needed for ``pip install lxml`` (``gcc``,
622
-        # ``libxml2-dev`` and ``libxslt-dev``) are present in
623
-        # ``files/rpms/general``.
624
-        uninstall_package python-lxml
625
-    fi
626
-
627
-    # If the ``dbus`` package was installed by DevStack dependencies the
628
-    # uuid may not be generated because the service was never started (PR#598200),
629
-    # causing Nova to stop later on complaining that ``/var/lib/dbus/machine-id``
630
-    # does not exist.
631
-    sudo service messagebus restart
632
-
633
-    # ``setup.py`` contains a ``setup_requires`` package that is supposed
634
-    # to be transient.  However, RHEL6 distribute has a bug where
635
-    # ``setup_requires`` registers entry points that are not cleaned
636
-    # out properly after the setup-phase resulting in installation failures
637
-    # (bz#924038).  Pre-install the problem package so the ``setup_requires``
638
-    # dependency is satisfied and it will not be installed transiently.
639
-    # Note we do this before the track-depends below.
640
-    pip_install hgtools
641
-
642
-    # RHEL6's version of ``python-nose`` is incompatible with Tempest.
643
-    # Install nose 1.1 (Tempest-compatible) from EPEL
644
-    install_package python-nose1.1
645
-    # Add a symlink for the new nosetests to allow tox for Tempest to
646
-    # work unmolested.
647
-    sudo ln -sf /usr/bin/nosetests1.1 /usr/local/bin/nosetests
648
-fi
649
-
650 592
 install_rpc_backend
651 593
 
652 594
 if is_service_enabled $DATABASE_BACKENDS; then
... ...
@@ -9,10 +9,17 @@
9 9
 #   pip 1.4 doesn't fix it (1.3 did)
10 10
 # - httplib2 0.8 permissions are 600 in the package and
11 11
 #   pip 1.4 doesn't fix it (1.3 did)
12
+# - RHEL6:
13
+#   - set selinux not enforcing
14
+#   - (re)start messagebus daemon
15
+#   - remove distro packages python-crypto and python-lxml
16
+#   - pre-install hgtools to work around a bug in RHEL6 distribute
17
+#   - install nose 1.1 from EPEL
18
+
12 19
 
13 20
 # Keep track of the current directory
14 21
 TOOLS_DIR=$(cd $(dirname "$0") && pwd)
15
-TOP_DIR=`cd $TOOLS_DIR/..; pwd`
22
+TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
16 23
 
17 24
 # Change dir to top of devstack
18 25
 cd $TOP_DIR
... ...
@@ -22,6 +29,10 @@ source $TOP_DIR/functions
22 22
 
23 23
 FILES=$TOP_DIR/files
24 24
 
25
+
26
+# Python Packages
27
+# ---------------
28
+
25 29
 # Pre-install affected packages so we can fix the permissions
26 30
 sudo pip install prettytable
27 31
 sudo pip install httplib2
... ...
@@ -41,3 +52,65 @@ for dir in $SITE_DIRS; do
41 41
     fi
42 42
 
43 43
 done
44
+
45
+
46
+# RHEL6
47
+# -----
48
+
49
+if [[ $DISTRO =~ (rhel6) ]]; then
50
+
51
+    # Disable selinux to avoid configuring to allow Apache access
52
+    # to Horizon files or run nodejs (LP#1175444)
53
+    # FIXME(dtroyer): see if this can be skipped without node or if Horizon is not enabled
54
+    if selinuxenabled; then
55
+        sudo setenforce 0
56
+    fi
57
+
58
+    # If the ``dbus`` package was installed by DevStack dependencies the
59
+    # uuid may not be generated because the service was never started (PR#598200),
60
+    # causing Nova to stop later on complaining that ``/var/lib/dbus/machine-id``
61
+    # does not exist.
62
+    sudo service messagebus restart
63
+
64
+    # The following workarounds break xenserver
65
+    if [ "$VIRT_DRIVER" != 'xenserver' ]; then
66
+        # An old version of ``python-crypto`` (2.0.1) may be installed on a
67
+        # fresh system via Anaconda and the dependency chain
68
+        # ``cas`` -> ``python-paramiko`` -> ``python-crypto``.
69
+        # ``pip uninstall pycrypto`` will remove the packaged ``.egg-info``
70
+        #  file but leave most of the actual library files behind in
71
+        # ``/usr/lib64/python2.6/Crypto``. Later ``pip install pycrypto``
72
+        # will install over the packaged files resulting
73
+        # in a useless mess of old, rpm-packaged files and pip-installed files.
74
+        # Remove the package so that ``pip install python-crypto`` installs
75
+        # cleanly.
76
+        # Note: other RPM packages may require ``python-crypto`` as well.
77
+        # For example, RHEL6 does not install ``python-paramiko packages``.
78
+        uninstall_package python-crypto
79
+
80
+        # A similar situation occurs with ``python-lxml``, which is required by
81
+        # ``ipa-client``, an auditing package we don't care about.  The
82
+        # build-dependencies needed for ``pip install lxml`` (``gcc``,
83
+        # ``libxml2-dev`` and ``libxslt-dev``) are present in
84
+        # ``files/rpms/general``.
85
+        uninstall_package python-lxml
86
+    fi
87
+
88
+    # ``setup.py`` contains a ``setup_requires`` package that is supposed
89
+    # to be transient.  However, RHEL6 distribute has a bug where
90
+    # ``setup_requires`` registers entry points that are not cleaned
91
+    # out properly after the setup-phase resulting in installation failures
92
+    # (bz#924038).  Pre-install the problem package so the ``setup_requires``
93
+    # dependency is satisfied and it will not be installed transiently.
94
+    # Note we do this before the track-depends in ``stack.sh``.
95
+    pip_install hgtools
96
+
97
+
98
+    # RHEL6's version of ``python-nose`` is incompatible with Tempest.
99
+    # Install nose 1.1 (Tempest-compatible) from EPEL
100
+    install_package python-nose1.1
101
+    # Add a symlink for the new nosetests to allow tox for Tempest to
102
+    # work unmolested.
103
+    sudo ln -sf /usr/bin/nosetests1.1 /usr/local/bin/nosetests
104
+
105
+fi