From 47ec7c8e0c48d01e6f3618170df1a880d188074f Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 1 Jun 2017 08:25:10 -0400 Subject: [PATCH] Switch incorrect symlink order All this did was symlnk pip2 to pip, which became installed by python3 on our previous run. We need to properly revert this on our production systems now. Change-Id: Ie27c4476ecea9d0a29f40400bbc3bdbe704905a6 Signed-off-by: Paul Belanger --- manifests/init.pp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index e8c06eb..be190d8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -30,11 +30,22 @@ class pip ( # NOTE(pabelanger): Default to pip2 for backwards compat exec { $::pip::params::get_pip_path: - command => "ln -sf ${::pip::params::get_pip_path} ${::pip::params::get_pip2_path}", + command => "ln -sf ${::pip::params::get_pip2_path} ${::pip::params::get_pip_path}", path => '/usr/bin:/bin/', refreshonly => true, } + # NOTE(pabelanger): We need to unlink pip2 because, it just symlinks to pip. + # And it is possible that pip is currently python3. This should then cause + # download-pip to run again. And default pip to python2 again. + # This code will be removed once pip has been switched back to python2. + exec { 'unlink pip2': + command => "unlink ${::pip::params::get_pip2_path}", + path => '/usr/bin:/bin/', + onlyif => "test -L ${::pip::params::get_pip2_path}", + notify => Exec['download-pip'], + } + if $manage_pip_conf { file { '/etc/pip.conf': owner => 'root',