stankevich/puppet-python — pull request #135 by ive (2014-10-28 08:58:09+00:00)
Title: Fixed pip non-root installation

This commit fixes error that I have faced running puppet for installing pip package from non-root user:

Debug: Executing '/srv/naas/375eec2/bin/pip wheel --help > /dev/null 2>&1 && { /srv/naas/375eec2/bin/pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { /srv/naas/375eec2/bin/pip --log /srv/naas/375eec2/pip.log install $wheel_support_flag -v -e git+https://rusichenko:gtY02u+t2oqf@gerrit.mirantis.com/pacnet/naas@375eec2d13e155c84822cf090f6b12baa473adb2#egg=naas || /srv/naas/375eec2/bin/pip --log /srv/naas/375eec2/pip.log install -v -e git+https://rusichenko:gtY02u+t2oqf@gerrit.mirantis.com/pacnet/naas@375eec2d13e155c84822cf090f6b12baa473adb2#egg=naas ;}'
Notice: /Stage[main]/Naas::Install/Python::Pip[naas]/Exec[pip_install_naas]/returns: Obtaining naas from git+https://rusichenko:gtY02u+t2oqf@gerrit.mirantis.com/pacnet/naas@375eec2d13e155c84822cf090f6b12baa473adb2#egg=naas
Notice: /Stage[main]/Naas::Install/Python::Pip[naas]/Exec[pip_install_naas]/returns: Cloning https://rusichenko:gtY02u+t2oqf@gerrit.mirantis.com/pacnet/naas (to 375eec2d13e155c84822cf090f6b12baa473adb2) to /srv/naas/375eec2/src/naas
Notice: /Stage[main]/Naas::Install/Python::Pip[naas]/Exec[pip_install_naas]/returns: Found command 'git' at '/usr/bin/git'
Notice: /Stage[main]/Naas::Install/Python::Pip[naas]/Exec[pip_install_naas]/returns: fatal: Could not change back to '/root': Permission denied
Notice: /Stage[main]/Naas::Install/Python::Pip[naas]/Exec[pip_install_naas]/returns: Complete output from command /usr/bin/git clone -q https://rusichenko:gtY02u+t2oqf@gerrit.mirantis.com/pacnet/naas /srv/naas/375eec2/src/naas:

The problem that puppet run command in a way - sudo -u $user $cmd, not changing current working directory and pip tries to access /root/pip.log and failed.