diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 17361e583c..f8c5bdc891 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -379,7 +379,7 @@ IM_MAD = [ # # type : driver type, supported drivers: xen, kvm, xml # -# keep_snapshots: do not remove snapshots on power on/off cycles and live +# keep_snapshots: do not remove snapshots on power on/off cycles and live # migrations if the hypervisor supports that. # # imported_vms_actions : comma-separated list of actions supported @@ -560,6 +560,7 @@ DATASTORE_MAD = [ # arguments : for the driver executable # -t number of threads, i.e. number of repo operations at the same time # -m marketplace mads separated by commas +# --proxy proxy address if required to access the internet #******************************************************************************* MARKET_MAD = [ diff --git a/src/mad/sh/madcommon.sh b/src/mad/sh/madcommon.sh index d4948149dd..68442ae09a 100644 --- a/src/mad/sh/madcommon.sh +++ b/src/mad/sh/madcommon.sh @@ -58,6 +58,28 @@ function execute_mad fi } +function set_proxy +{ + local proxy_found proxy arg + + proxy_found=false + + for arg in $*; do + echo "arg: |${arg}|" >> /tmp/proxy + if $proxy_found ; then + proxy=$arg + break + else + if [ "$arg" = "--proxy" ]; then + proxy_found=true + fi + fi + done + + if [ -n "$proxy" ]; then + export http_proxy=$proxy + fi +} # Set global environment if [ -z "${ONE_LOCATION}" ]; then @@ -89,3 +111,5 @@ if [ $? = 0 ]; then RUBYLIB="${RUBYLIB}$(echo $VENDOR/*/lib | tr ' ' ':')" fi +# Set the proxy if defined +set_proxy "$@" diff --git a/src/market_mad/one_market.rb b/src/market_mad/one_market.rb index f87ee2d1d9..a97b3eb6dc 100755 --- a/src/market_mad/one_market.rb +++ b/src/market_mad/one_market.rb @@ -281,7 +281,8 @@ end opts = GetoptLong.new( [ '--threads', '-t', GetoptLong::OPTIONAL_ARGUMENT ], - [ '--market-types', '-m', GetoptLong::OPTIONAL_ARGUMENT ] + [ '--market-types', '-m', GetoptLong::OPTIONAL_ARGUMENT ], + [ '--proxy' , GetoptLong::OPTIONAL_ARGUMENT ] ) mp_type = nil diff --git a/src/market_mad/remotes/one/monitor b/src/market_mad/remotes/one/monitor index 1b6978462c..a71345a309 100755 --- a/src/market_mad/remotes/one/monitor +++ b/src/market_mad/remotes/one/monitor @@ -38,7 +38,7 @@ class OneMarket req['User-Agent'] = @agent - response = Net::HTTP.start(uri.hostname, uri.port) {|http| + response = Net::HTTP.start(uri.hostname, uri.port, :ENV) {|http| http.request(req) }