bug 1464458: don't set --trusted-host on windows, because the pip there doesn't support it. r=aki
authorBen Hearsum <bhearsum@mozilla.com>
Fri, 25 May 2018 15:30:29 -0400
changeset 6916 e64c2beb84de02bff005367106b24922e5223b3c
parent 6915 b68369cbad346145359ed841fc49444783222057
child 6917 fa6d2bfd18b45a3bee15a5294670c6476d0774e5
child 6919 f916f6c6adc16ae1e9392f4d4a546f2b8ce47273
push id2778
push userasasaki@mozilla.com
push dateTue, 29 May 2018 19:35:39 +0000
reviewersaki
bugs1464458
bug 1464458: don't set --trusted-host on windows, because the pip there doesn't support it. r=aki
modules/python/manifests/virtualenv/package.pp
--- a/modules/python/manifests/virtualenv/package.pp
+++ b/modules/python/manifests/virtualenv/package.pp
@@ -14,21 +14,29 @@ define python::virtualenv::package($user
     $virtualenv   = regsubst($title, '\|\|.*$', '')
     $pkg          = regsubst($title, '^.*\|\|', '')
 
     $pip_check_py = $python::pip_check_py::file
     # give a --find-links option for each data server, so pip will search them all.
     $data_server  = $config::data_server
     $data_servers = $config::data_servers
 
-    $pip_options  = inline_template("--no-deps --no-index <%
+    $pip_options = $::operatingsystem ? {
+        # No trusted host on windows, because those are ancient buildbot machines whose pip doesn't support it.
+        windows => inline_template("--no-deps --no-index <%
+servers = [ @data_server ] + Array(@data_servers)
+servers.uniq.each do |mirror_server| -%> --find-links=http://<%= mirror_server %>/python/packages <%
+end
+-%>"),
+        default => inline_template("--no-deps --no-index <%
 servers = [ @data_server ] + Array(@data_servers)
 servers.uniq.each do |mirror_server| -%> --trusted-host <%= mirror_server %> --find-links=http://<%= mirror_server %>/python/packages <%
 end
 -%>")
+    }
     if ($user == 'root') {
         $home_dir = $::users::root::home
     } else {
         $home_dir = $::operatingsystem ? {
             Darwin  => "/Users/${user}",
             default => "/home/${user}"
         }
     }