Browse code

support no_proxy environment variable

Change-Id: I5175f9752abe358cca0d2e3e5cf6d94605df451a

Osamu Habuka authored on 2012/07/25 12:39:32
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
 
... ...
@@ -479,6 +480,7 @@ function pip_install {
479 479
     sudo PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
480 480
         HTTP_PROXY=$http_proxy \
481 481
         HTTPS_PROXY=$https_proxy \
482
+        NO_PROXY=$no_proxy \
482 483
         $CMD_PIP install --use-mirrors $@
483 484
 }
484 485
 
... ...
@@ -509,6 +511,7 @@ function setup_develop() {
509 509
         sudo \
510 510
             HTTP_PROXY=$http_proxy \
511 511
             HTTPS_PROXY=$https_proxy \
512
+            NO_PROXY=$no_proxy \
512 513
             python setup.py develop \
513 514
     )
514 515
 }
... ...
@@ -562,6 +565,7 @@ function yum_install() {
562 562
     local sudo="sudo"
563 563
     [[ "$(id -u)" = "0" ]] && sudo="env"
564 564
     $sudo http_proxy=$http_proxy https_proxy=$https_proxy \
565
+        no_proxy=$no_proxy \
565 566
         yum install -y "$@"
566 567
 }
567 568
 
... ...
@@ -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}