IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2013, 1:37:30 PM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130509
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509

  • branches/eam_branches/ipp-20130509/pstamp/scripts

  • branches/eam_branches/ipp-20130509/pstamp/scripts/pstamp_save_server_status.pl

    r30469 r35594  
    1212use Pod::Usage qw( pod2usage );
    1313
    14 # XXX: We should get this from site.config, but that would about double
    15 # the execution time for this script.
    16 my $rundir = "/data/ippc17.0/pstamp";
    17 
    18 my $status_file = "$rundir/web/status.html";
    19 
    2014my $updatelink;
    2115my $verbose;
    2216my $save_temps;
     17my $pstamp_workdir;
    2318
    2419GetOptions(
    25     'rundir=s'      => \$rundir,
     20    'workdir=s'      => \$pstamp_workdir,
    2621    'update-link'    => \$updatelink,
    2722    'verbose'       => \$verbose,
     
    3732}
    3833
     34if (!$pstamp_workdir) {
     35    my $ipprc = PS::IPP::Config->new(); # IPP Configuration
     36    $pstamp_workdir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_WORKDIR');
     37}
     38
     39if (!$pstamp_workdir) {
     40    warn("Failed to find PSTAMP_WORKDIR in the config\n");
     41    exit($PS_EXIT_CONFIG_ERROR);
     42}
     43my $status_file = "$pstamp_workdir/server_status/status.html";
     44
    3945my ($sec, $min, $hour, $mday, $month, $year) = gmtime;
    4046$year += 1900;
    4147$month += 1;
    4248
    43 my $dir = sprintf "$rundir/work/server_status/%4d/%02d/%02d", $year, $month, $mday;
     49my $dir = sprintf "$pstamp_workdir/server_status/%4d/%02d/%02d", $year, $month, $mday;
    4450
    4551if (!-e $dir ) {
  • branches/eam_branches/ipp-20130509/pstamp/test/maketestreq

    r35441 r35594  
    3030}
    3131
    32 # XXX: get these from site.config
    33 $pstamptool .= " -dbserver ippc19 -dbname ippRequestServer";
    34 
    3532
    3633my ($input, $submit, $listfile, $delete, $simple, $tag_req_name, $req_name, $email);
     34my ($dbname, $dbserver);
    3735my ($save_temps, $verbose);
    3836
     
    5048    'label=s'           => \$label,
    5149    'email=s'           => \$email,
     50
     51    'dbname=s'           => \$dbname,
     52    'dbserver=s'         => \$dbserver,
    5253
    5354    'listfile|l'        => \$listfile,
     
    6869die ("Input file $input not found\n") unless (-e $input);
    6970die ("Input file $input not readable\n") unless (-r $input);
     71
     72if (!$dbname or !$dbserver) {
     73    my $ipprc = PS::IPP::Config->new('GPC1');
     74
     75    if (!$dbserver) {
     76        $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
     77        die ("couldn't find dbserver in site.config\n") unless $dbserver;
     78    }
     79    if (!$dbname) {
     80        $dbname =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBNAME');
     81        die ("couldn't find dbname in site.config\n") unless $dbname;
     82    }
     83}
     84$pstamptool .= " -dbserver $dbserver -dbname $dbname";
     85
    7086
    7187# if request name was not supplied make one
Note: See TracChangeset for help on using the changeset viewer.