Browse code

Use proper python when configuring certs

We have to do silly overrides of cert locations for requests for
reasons. If we are running under python3 then we were previously looking
in the wrong location for the requests certs. Update the cert fixing
function to properly use python3 to find the certs if python3 is
enabled.

Change-Id: Id1369da0d812edcf9b1204e9c567f8bfe77c48b2

Clark Boylan authored on 2017/05/28 12:53:20
Showing 2 changed files
... ...
@@ -345,7 +345,8 @@ function make_root_CA {
345 345
 function fix_system_ca_bundle_path {
346 346
     if is_service_enabled tls-proxy; then
347 347
         local capath
348
-        capath=$(python -c $'try:\n from requests import certs\n print certs.where()\nexcept ImportError: pass')
348
+        local python_cmd=${1:-python}
349
+        capath=$($python_cmd -c $'try:\n from requests import certs\n print (certs.where())\nexcept ImportError: pass')
349 350
 
350 351
         if [[ ! $capath == "" && ! $capath =~ ^/etc/.* && ! -L $capath ]]; then
351 352
             if is_fedora; then
... ...
@@ -888,6 +888,9 @@ fi
888 888
 
889 889
 if is_service_enabled tls-proxy; then
890 890
     fix_system_ca_bundle_path
891
+    if python3_enabled ; then
892
+        fix_system_ca_bundle_path python3
893
+    fi
891 894
 fi
892 895
 
893 896
 # Extras Install