From 0aa8534ada621becb3a6bd14e4e6b5faabde9dd6 Mon Sep 17 00:00:00 2001 From: JUN JIE NAN Date: Fri, 13 Sep 2013 15:47:09 +0800 Subject: [PATCH] Using no proxy option to skip wget and curl proxy settings in config When end users specify proxy settings in config file for wget /etc/wgetrc: http_proxy = http://... or for curl ${HOME}/.curlrc: proxy = http://... Using `http_proxy="" wget' can not skip the proxy setting in the config files, also it can skip proxy settings in env viriables. In order to skip proxy setting in both env and config file, we pass --no-proxy option for wget, and --noproxy '*' for curl. Fixes bug #1224836 Change-Id: I2b25aeca9edf2ce4525fb1db325e5e24c18b4d55 --- functions | 2 +- lib/glance | 2 +- lib/ironic | 2 +- lib/keystone | 2 +- lib/neutron | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions b/functions index 83826f9327..fb2f3a3df1 100644 --- a/functions +++ b/functions @@ -1484,7 +1484,7 @@ function use_exclusive_service { function wait_for_service() { local timeout=$1 local url=$2 - timeout $timeout sh -c "while ! http_proxy= https_proxy= curl -s $url >/dev/null; do sleep 1; done" + timeout $timeout sh -c "while ! curl --noproxy '*' -s $url >/dev/null; do sleep 1; done" } diff --git a/lib/glance b/lib/glance index 7e6968200f..c6f11d06da 100644 --- a/lib/glance +++ b/lib/glance @@ -193,7 +193,7 @@ function start_glance() { screen_it g-reg "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf" screen_it g-api "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf" echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then + if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then die $LINENO "g-api did not start" fi } diff --git a/lib/ironic b/lib/ironic index 072d2ded82..f3b4a72f66 100644 --- a/lib/ironic +++ b/lib/ironic @@ -194,7 +194,7 @@ function start_ironic() { function start_ironic_api() { screen_it ir-api "cd $IRONIC_DIR; $IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE" echo "Waiting for ir-api ($IRONIC_HOSTPORT) to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$IRONIC_HOSTPORT; do sleep 1; done"; then + if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$IRONIC_HOSTPORT; do sleep 1; done"; then die $LINENO "ir-api did not start" fi } diff --git a/lib/keystone b/lib/keystone index 699b94abb5..c93a4367d2 100755 --- a/lib/keystone +++ b/lib/keystone @@ -372,7 +372,7 @@ function start_keystone() { fi echo "Waiting for keystone to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= curl -s http://$SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/ >/dev/null; do sleep 1; done"; then + if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://$SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/ >/dev/null; do sleep 1; done"; then die $LINENO "keystone did not start" fi diff --git a/lib/neutron b/lib/neutron index 4a3d1b06a6..efbb45c16e 100644 --- a/lib/neutron +++ b/lib/neutron @@ -419,7 +419,7 @@ function start_neutron_service_and_check() { # Start the Neutron service screen_it q-svc "cd $NEUTRON_DIR && python $NEUTRON_BIN_DIR/neutron-server $CFG_FILE_OPTIONS" echo "Waiting for Neutron to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then + if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then die $LINENO "Neutron did not start" fi }