Ubuntu Pastebin

Paste from ubuntu at Wed, 24 Jun 2015 17:46:28 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/tools/pip-env b/tools/pip-env
new file mode 100755
index 0000000..9a5b157
--- /dev/null
+++ b/tools/pip-env
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+#
+# Execute pip but with modified environment.
+#   pip_http_proxy  -> http_proxy
+#   pip_https_proxy -> pip_https_proxy
+import os
+import sys
+
+for k in ('http_proxy', 'https_proxy'):
+    if 'pip_' + k in os.environ:
+        os.environ[k] = os.environ['pip_']
+
+os.execve(sys.argv[1], sys.argv[1:], os.environ)
diff --git a/tox.ini b/tox.ini
index 5d6e861..2385ca7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,6 +14,7 @@ setenv = VIRTUAL_ENV={envdir}
 deps = -r{toxinidir}/test-requirements.txt
     -r{toxinidir}/requirements.txt
 commands = nosetests {posargs}
+install_command = {toxinidir}/tools/pip-env pip install {opts} {packages}
 
 [testenv:py27-coverage]
 commands = nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-html {posargs}
Download as text