bug 1463592 - fix mac pip.conf installs. r=bustage
authorAki Sasaki <asasaki@mozilla.com>
Tue, 29 May 2018 10:17:51 -0700
changeset 6922 23db99a37be5f65f5c4a7d0d795b1f53ff5668a4
parent 6921 4ce48f49cd8832688f860a27cd62cb4a585dd53f
child 6923 aad7dbb34b77fa75d3167aafbbcea5f85a246607
push id2778
push userasasaki@mozilla.com
push dateTue, 29 May 2018 19:35:39 +0000
reviewersbustage
bugs1463592
bug 1463592 - fix mac pip.conf installs. r=bustage
modules/python/manifests/system_pip_conf.pp
--- a/modules/python/manifests/system_pip_conf.pp
+++ b/modules/python/manifests/system_pip_conf.pp
@@ -13,34 +13,44 @@ class python::system_pip_conf {
             $group    = "root"
         }
         "Ubuntu": {
             $filename = "/etc/pip.conf"
             $user     = "root"
             $group    = "root"
         }
         "Darwin": {
-            $filename = "/Library/Application Support/pip/pip.conf"
+            $dir      = "/Library/Application Support/pip/"
+            $filename = "${dir}/pip.conf"
             $user     = "root"
             $group    = "wheel"
         }
         "windows": {
-            $filename = $::operatingsystemrelease ? {
-                XP => "C:\\Documents and Settings\\All Users\\Application Data\\pip\\pip.ini",
-                default => "C:\\ProgramData\\pip\\pip.ini",
+            $dir = $::operatingsystemrelease ? {
+                XP => "C:\\Documents and Settings\\All Users\\Application Data\\pip",
+                default => "C:\\ProgramData\\pip",
             }
+            $filename = "${dir}\\pip.ini"
             $user     = "administrator"
             $group    = "administrator"
         }
         default: {
             fail("This OS is not supported for system_pip_conf")
         }
     }
+    if $dir {
+        directory {
+            "${dir}":
+                owner => $user,
+                group => $group,
+                mode  => "0755";
+        }
+    }
     if $filename {
         file {
             "${filename}":
                 content => template("python/user-pip-conf.erb"),
                 owner   => $user,
                 group   => $group,
-                mode    => "0755";
+                mode    => "0644";
         }
     }
 }