Browse Source

Additional fixes for RHEL 8 support

- pip install needs /usr as a prefix, otherwise packstack is installed
  under /usr/local/bin, which is not a valid path for sudo.
- iptables package is required.
- SSL certificates need to be decoded when writing, to avoid string
  issues.

Change-Id: Ia49ebda480ace91c6727c887c4cd8394cfefcfff
Javier Pena 2 months ago
parent
commit
316fad0d10
3 changed files with 9 additions and 8 deletions
  1. 3
    3
      packstack/modules/ospluginutils.py
  2. 4
    4
      packstack/plugins/ssl_001.py
  3. 2
    1
      run_tests.sh

+ 3
- 3
packstack/modules/ospluginutils.py View File

@@ -140,11 +140,11 @@ def generate_ssl_cert(config, host, service, ssl_key_file, ssl_cert_file):
140 140
         final_cert = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
141 141
         final_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, k)
142 142
         deliver_ssl_file(ca_file, config['CONFIG_SSL_CACERT'], host)
143
-        deliver_ssl_file(final_cert, ssl_cert_file, host)
144
-        deliver_ssl_file(final_key, ssl_key_file, host)
143
+        deliver_ssl_file(final_cert.decode(), ssl_cert_file, host)
144
+        deliver_ssl_file(final_key.decode(), ssl_key_file, host)
145 145
 
146 146
         with open(local_cert_path, 'w') as f:
147
-            f.write(final_cert)
147
+            f.write(final_cert.decode())
148 148
 
149 149
 
150 150
 def deliver_ssl_file(content, path, host):

+ 4
- 4
packstack/plugins/ssl_001.py View File

@@ -280,10 +280,10 @@ def create_self_signed_cert(config, messages):
280 280
 
281 281
         cert.sign(k, 'sha1')
282 282
 
283
-        open((CERT_FILE), "wt").write(
284
-            crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
285
-        open((KEY_FILE), "wt").write(
286
-            crypto.dump_privatekey(crypto.FILETYPE_PEM, k))
283
+        open((CERT_FILE), "w").write(
284
+            crypto.dump_certificate(crypto.FILETYPE_PEM, cert).decode())
285
+        open((KEY_FILE), "w").write(
286
+            crypto.dump_privatekey(crypto.FILETYPE_PEM, k).decode())
287 287
 
288 288
         messages.append(
289 289
             "%sNOTE%s : A selfsigned CA certificate was generated to be used "

+ 2
- 1
run_tests.sh View File

@@ -145,6 +145,7 @@ fi
145 145
 # Install dependencies
146 146
 $SUDO $PKG_MGR -y install puppet \
147 147
                      iproute \
148
+                     iptables \
148 149
                      dstat \
149 150
                      openssl-devel \
150 151
                      libffi-devel \
@@ -266,7 +267,7 @@ fi
266 267
 
267 268
 # Setup packstack
268 269
 if [ "${INSTALL_FROM_SOURCE}" = true ]; then
269
-  $SUDO $PIP install .
270
+  $SUDO $PIP install --prefix=/usr .
270 271
   # In Fedora when running with sudo gems are installed at /usr/local/bin/ even when GEM_HOME/GEM_BIN_DIR are set
271 272
   if [ "${PKG_MGR}" = "dnf" ]; then
272 273
       export GEM_BIN_DIR=/usr/local/bin/

Loading…
Cancel
Save