From fa90f31cc8ca2762e84327d04c15c8541a7d05e5 Mon Sep 17 00:00:00 2001 From: Veeti Paananen Date: Fri, 13 Dec 2013 00:12:24 +0200 Subject: [PATCH] Fix permission error when using easy_install through sudo Same as b2542bff72d8b4f5adeec3e0bf6c14c64aaa7e18. --- library/packaging/easy_install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/packaging/easy_install b/library/packaging/easy_install index 88f867dd285..eae361c4321 100644 --- a/library/packaging/easy_install +++ b/library/packaging/easy_install @@ -19,6 +19,7 @@ # along with Ansible. If not, see . # +import tempfile import os.path DOCUMENTATION = ''' @@ -151,6 +152,7 @@ def main(): command = '%s %s' % (virtualenv, env) if site_packages: command += ' --system-site-packages' + os.chdir(tempfile.gettempdir()) rc_venv, out_venv, err_venv = module.run_command(command) rc += rc_venv