Browse code

Merge "support no_proxy environment variable"

Jenkins authored on 2012/08/11 06:43:46
Showing 3 changed files
... ...
@@ -29,6 +29,7 @@ Josh Kearney <josh@jk0.org>
29 29
 Justin Shepherd <galstrom21@gmail.com>
30 30
 Ken Pepple <ken.pepple@rabbityard.com>
31 31
 Kiall Mac Innes <kiall@managedit.ie>
32
+Osamu Habuka <xiu.yushen@gmail.com>
32 33
 Russell Bryant <rbryant@redhat.com>
33 34
 Scott Moser <smoser@ubuntu.com>
34 35
 Thierry Carrez <thierry@openstack.org>
... ...
@@ -17,6 +17,7 @@ function apt_get() {
17 17
     [[ "$(id -u)" = "0" ]] && sudo="env"
18 18
     $sudo DEBIAN_FRONTEND=noninteractive \
19 19
         http_proxy=$http_proxy https_proxy=$https_proxy \
20
+        no_proxy=$no_proxy \
20 21
         apt-get --option "Dpkg::Options::=--force-confold" --assume-yes "$@"
21 22
 }
22 23
 
... ...
@@ -486,6 +487,7 @@ function pip_install {
486 486
     $SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
487 487
         HTTP_PROXY=$http_proxy \
488 488
         HTTPS_PROXY=$https_proxy \
489
+        NO_PROXY=$no_proxy \
489 490
         $CMD_PIP install --use-mirrors $@
490 491
 }
491 492
 
... ...
@@ -521,6 +523,7 @@ function setup_develop() {
521 521
         $SUDO_CMD \
522 522
             HTTP_PROXY=$http_proxy \
523 523
             HTTPS_PROXY=$https_proxy \
524
+            NO_PROXY=$no_proxy \
524 525
             python setup.py develop \
525 526
     )
526 527
 }
... ...
@@ -574,6 +577,7 @@ function yum_install() {
574 574
     local sudo="sudo"
575 575
     [[ "$(id -u)" = "0" ]] && sudo="env"
576 576
     $sudo http_proxy=$http_proxy https_proxy=$https_proxy \
577
+        no_proxy=$no_proxy \
577 578
         yum install -y "$@"
578 579
 }
579 580
 
... ...
@@ -60,16 +60,21 @@ fi
60 60
 source $TOP_DIR/stackrc
61 61
 
62 62
 # HTTP and HTTPS proxy servers are supported via the usual environment variables
63
-# ``http_proxy`` and ``https_proxy``.  They can be set in ``localrc`` if necessary
63
+# ``http_proxy`` and ``https_proxy``.  Additionally if you would like to access
64
+# to specific server directly and not through the proxy server, you can use
65
+# ``no_proxy`` environment variable.  They can be set in ``localrc`` if necessary
64 66
 # or on the command line::
65 67
 #
66
-#     http_proxy=http://proxy.example.com:3128/ ./stack.sh
68
+#     http_proxy=http://proxy.example.com:3128/ no_proxy=repo.example.net ./stack.sh
67 69
 if [[ -n "$http_proxy" ]]; then
68 70
     export http_proxy=$http_proxy
69 71
 fi
70 72
 if [[ -n "$https_proxy" ]]; then
71 73
     export https_proxy=$https_proxy
72 74
 fi
75
+if [[ -n "$no_proxy" ]]; then
76
+    export no_proxy=$no_proxy
77
+fi
73 78
 
74 79
 # Destination path for installation ``DEST``
75 80
 DEST=${DEST:-/opt/stack}