IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26158


Ignore:
Timestamp:
Nov 16, 2009, 3:51:29 PM (16 years ago)
Author:
bills
Message:

Add support for running the data store tools using a proxy server.
This is accomplished by using 'standard' environment variables like
http_proxy and https_proxy.
--no-proxy argument is added to the tools to prevent this behavior.

Location:
trunk/DataStore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/lib/DataStore/File.pm

    r17552 r26158  
    233233                optional    => 1,
    234234            },
     235            no_proxy     => {
     236                type        => SCALAR,
     237                optional    => 1,
     238            },
    235239        },
    236240    );
     
    245249        $ua = LWP::UserAgent->new;
    246250    }
     251
     252    # load proxy environment variables (if any)
     253    if (!$p{no_proxy}) {
     254        $ua->env_proxy;
     255    }
     256
    247257    my $request = HTTP::Request->new(GET => $self->uri);
    248258    my $filename = $p{filename};
  • trunk/DataStore/lib/DataStore/FileSet.pm

    r17637 r26158  
    189189        {
    190190            ua_args     => {
     191                optional    => 1,
     192            },
     193            no_proxy     => {
     194                type        => SCALAR,
    191195                optional    => 1,
    192196            },
     
    201205        $ua = LWP::UserAgent->new;
    202206    }
     207
     208    if (!$p{no_proxy}) {
     209        # load proxy environment variables (if any)
     210        $ua->env_proxy;
     211    }
     212
    203213    my $request = HTTP::Request->new(GET => $self->uri);
    204214    my $response = $ua->request($request);
  • trunk/DataStore/lib/DataStore/Product.pm

    r17637 r26158  
    172172                optional    => 1,
    173173            },
     174            no_proxy     => {
     175                type        => SCALAR,
     176                optional    => 1,
     177            },
    174178        },
    175179    );
     
    182186        $ua = LWP::UserAgent->new;
    183187    }
     188
     189    if (!$p{no_proxy}) {
     190        # load proxy environment variables (if any)
     191        $ua->env_proxy;
     192    }
    184193
    185194    my $request;
  • trunk/DataStore/lib/DataStore/Root.pm

    r17637 r26158  
    136136                optional    => 1,
    137137            },
     138            no_proxy        => {
     139                type        => SCALAR,
     140                optional    => 1,
     141            },
    138142        },
    139143    );
     
    145149    } else {
    146150        $ua = LWP::UserAgent->new;
     151    }
     152
     153    if (!$p{no_proxy}) {
     154        # load proxy environment variables (if any)
     155        $ua->env_proxy;
    147156    }
    148157
  • trunk/DataStore/scripts/dsfilesetls

    r17752 r26158  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($uri, $timeout);
     18my ($uri, $timeout, $no_proxy);
    1919
    2020GetOptions(
    2121    'uri|u=s'           => \$uri,
    2222    'timeout|t=s'       => \$timeout,
     23    'no-proxy'          => \$no_proxy,
    2324) or pod2usage( 2 );
    2425
     
    3132# default http request timeout is 30s
    3233$timeout ||= 30;
     34$no_proxy = 0 if !defined $no_proxy;
    3335
    3436my $response = DataStore::FileSet->new( uri => $uri )->request(
    3537        ua_args  => { timeout => $timeout },
     38        no_proxy => $no_proxy,
    3639    );
    3740
     
    9194Optional.
    9295
     96=item * --no-proxy
     97
     98Do not load proxy environment variables.
     99
     100Optional.
     101
    93102=back
    94103
  • trunk/DataStore/scripts/dsget

    r25692 r26158  
    2828    $timeout,
    2929    @xattrs,
     30    $no_proxy,
    3031);
    3132
     
    4445    'timeout|t=s'   => \$timeout,
    4546    'xattr|x=s'     => \@xattrs,
     47    'no-proxy'      => \$no_proxy,
    4648) or pod2usage( 2 );
    4749
     
    8082# default http request timeout is 30s
    8183$timeout ||= 30;
     84$no_proxy = 0 if !defined $no_proxy;
    8285
    8386my %p = (
     
    140143        filename => $tmpfilename,
    141144        ua_args  => { timeout => $timeout },
     145        no_proxy => $no_proxy,
    142146    );
    143147
     
    302306Optional.
    303307
     308=item * --no-proxy
     309
     310Do not load proxy environment variables.
     311
     312Optional.
     313
    304314=item * --copies <n>
    305315
  • trunk/DataStore/scripts/dsgetfileset

    r25574 r26158  
    1717use File::Basename qw( basename );
    1818
    19 my ($uri, $outdir, $timeout, $verbose);
     19my ($uri, $outdir, $timeout, $no_proxy, $verbose);
    2020
    2121GetOptions(
     
    2323    'outdir|o=s'        => \$outdir,
    2424    'timeout|t=s'       => \$timeout,
     25    'no-proxy'          => \$no_proxy,
    2526    'verbose|v'         => \$verbose,
    2627) or pod2usage( 2 );
     
    3435# default http request timeout is 30s
    3536$timeout ||= 30;
     37$no_proxy = 0 if !defined $no_proxy;
    3638
    3739my $response = DataStore::FileSet->new( uri => $uri )->request(
    3840        ua_args  => { timeout => $timeout },
     41        no_proxy => $no_proxy,
    3942    );
    4043
     
    117120Optional.
    118121
     122=item * --no-proxy
     123
     124Do not load proxy environment variables.
     125
     126Optional.
     127
    119128=back
    120129
  • trunk/DataStore/scripts/dsleech

    r17739 r26158  
    1818use Pod::Usage qw( pod2usage );
    1919
    20 my ($dir, $uri, $last_fileset, $overwrite, $recall, $remember, $verbose, $timeout);
     20my ($dir, $uri, $last_fileset, $overwrite, $recall, $remember, $verbose, $timeout, $no_proxy);
    2121
    2222GetOptions(
     
    2929    'verbose|v'         => \$verbose,
    3030    'timeout|t'         => \$timeout,
     31    'no-proxy'          => \$no_proxy,
    3132) or pod2usage( 2 );
    3233
     
    3940# default http request timeout is 30s
    4041$timeout ||= 30;
     42$no_proxy = 0 if !defined $no_proxy;
    4143
    4244my %p = (
     
    6567my $response = DataStore::Product->new(%p)->request(
    6668    ua_args  => { timeout => $timeout },
     69    no_proxy => $no_proxy,
    6770);
    6871
     
    281284Optional.
    282285
     286=item * --no-proxy
     287
     288Do not load proxy environment variables.
     289
     290Optional.
     291
    283292=back
    284293
  • trunk/DataStore/scripts/dsproductls

    r25631 r26158  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($uri, $last_fileset, $timeout, $extra);
     18my ($uri, $last_fileset, $timeout, $extra, $no_proxy);
    1919
    2020GetOptions(
     
    2222    'last_fileset|l=s'  => \$last_fileset,
    2323    'timeout|t=s'       => \$timeout,
    24     'extra|e'         => \$extra,
     24    'extra|e'           => \$extra,
     25    'no-proxy'          => \$no_proxy,
    2526) or pod2usage( 2 );
    2627
     
    3334# default http request timeout is 30s
    3435$timeout ||= 30;
     36$no_proxy = 0 if !defined $no_proxy;
    3537
    3638my %p = (
     
    4244my $response = DataStore::Product->new(%p)->request(
    4345        ua_args  => { timeout => $timeout },
     46        no_proxy => $no_proxy,
    4447    );
    4548
     
    111114Optional.
    112115
     116=item * --no-proxy
     117
     118Do not load proxy environment variables.
     119
     120Optional.
     121
    113122=back
    114123
  • trunk/DataStore/scripts/dsrootls

    r17739 r26158  
    1616use Pod::Usage qw( pod2usage );
    1717
    18 my ($uri, $timeout);
     18my ($uri, $timeout, $no_proxy);
    1919
    2020GetOptions(
    2121    'uri|u=s'       => \$uri,
    2222    'timeout|t'     => \$timeout,
     23    'no-proxy'      => \$no_proxy,
    2324) or pod2usage( 2 );
    2425
     
    3132# default http request timeout is 30s
    3233$timeout ||= 30;
     34$no_proxy = 0 if !defined $no_proxy;
    3335
    3436my %p = (
     
    3840my $response = DataStore::Root->new(%p)->request(
    3941        ua_args  => { timeout => $timeout },
     42        no_proxy => $no_proxy,
    4043    );
    4144
     
    9396Optional.
    9497
     98=item * --no-proxy
     99
     100Do not load proxy environment variables.
     101
     102Optional.
     103
    95104=back
    96105
Note: See TracChangeset for help on using the changeset viewer.